Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bulk Insert Question
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00672742
Message ID:
00672822
Views:
19
Have you tried using a parameter for the filename from with QA. I'm betting that that syntax is not allowed. You can use Dynamic SQL as a work around.

-Mike

>Hi,
>
>I would like to create a SP to execute a BULK INSERT.
>
>If I run the following in QA - it works fine...
>
>
>
>BULK INSERT ATMPOS.dbo.[TransactionDetails]
>   FROM 'd:\testing99.txt'
>   WITH
>      (
>       FIELDTERMINATOR = '|',
>	   KEEPNULLS
>       )
>
>
>
>However, if I try the following, it doesn't work
>
>
>
>declare @PathVC varchar(100)
>
>set @PathVC = 'd:\testing99.txt'
>
>
>BULK INSERT ATMPOS.dbo.[TransactionDetails]
>   FROM @PathVC
>   WITH
>      (
>       FIELDTERMINATOR = '|',
>	   KEEPNULLS
>       )
>
>
>
>
>Can I not use a declared variabe containing the filename and path? Or, is there a better way to do this? I want to execute this from VB6.
>
>Thanks in advance.
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform