DavidKnight
Programmer
Hi All;
Here's todays issue. I have been able to execute the following Bulk Insert.
BULK INSERT DATA_FILE_TEST
FROM 'C:\Work\DataFile.csv'
WITH (formatfile='c:\work\DataFile.fmt',
firstrow=1,
lastrow=1);
Now I want to pass the csv file as a variable and have been unsuccessful. Even tried ''' + @file + ''', I'm missing something obviously.
Error is: Line 14: Incorrect syntax near '@file'.
DECLARE @file sysname
SET @file = 'C:\Work\DataFile.csv'
BULK INSERT DATA_FILE_TEST
FROM @file
WITH (formatfile='c:\work\DataFile.fmt',
firstrow=1,
lastrow=1);
Thanks In advance!
Here's todays issue. I have been able to execute the following Bulk Insert.
BULK INSERT DATA_FILE_TEST
FROM 'C:\Work\DataFile.csv'
WITH (formatfile='c:\work\DataFile.fmt',
firstrow=1,
lastrow=1);
Now I want to pass the csv file as a variable and have been unsuccessful. Even tried ''' + @file + ''', I'm missing something obviously.
Error is: Line 14: Incorrect syntax near '@file'.
DECLARE @file sysname
SET @file = 'C:\Work\DataFile.csv'
BULK INSERT DATA_FILE_TEST
FROM @file
WITH (formatfile='c:\work\DataFile.fmt',
firstrow=1,
lastrow=1);
Thanks In advance!