What am I doing wrong in the following snippet of code?
-----------------------------------
declare @FullPath varchar(255)
set @FullPath = 'C:\MyDir\MyFile.txt'
bulk insert Northwind.dbo.Sometable
from @FullPath
with
(FIELDTERMINATOR = ',')
-----------------------------------
This works when I write the path out instead of using the @FullPath
variable. I have a cursor that will Bulk Insert all files names from a
table. The path will not change but the file name will. I guess I could use
a system call to rename the file in use to a hardcoded name and then rename
back to original name but I would like find a way to make the above concept
work if it is possible.
TIA,
-p