Я использую приведенный ниже код в SP, SQL Server 2005
declare @path varchar(500)
set @path = 'E:\Support\test.csv';
print @path
Create table #mytable(
name varchar(max), class varchar(max), roll varchar(max)
)
BULK INSERT #mytable FROM @path
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
);
Go
select * from #mytable
drop table #mytable
Но выдает следующую ошибку:
Msg 102, Level 15, State 1, Line 8
Incorrect syntax near '@path'.
Msg 319, Level 15, State 1, Line 9
Incorrect syntax near the keyword 'with'.
If this statement is a common table expression or an xmlnamespaces clause,
the previous statement must be terminated with a semicolon.
Msg 208, Level 16, State 0, Line 1
Invalid object name '#mytable'.
Может ли кто-нибудь мне помочь.