I\'m trying to insert a CSV into a Temporary table and this SQL statement doesn\'t seem to work.
DECLARE @TempTable TABLE (FName nvarchar(max),SName nvarchar
You cannot BULK INSERT into a table variable. So this line:
BULK INSERT @TempTable
Is what is causing the error.
FYI, the simplest fix for this is probably just to use a #Temp table instead of a Table Variable. So your SQL code would change to this:
CREATE TABLE #TempTable (FName nvarchar(max),SName nvarchar(max),
Email nvarchar(max));
BULK INSERT #TempTable
FROM 'C:\52BB30AD694A62A03E.csv'
WITH (FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')