declare @DATADIR varchar(128)
set @DATADIR= 'C:\SQL2012\SH_DATA'
msg:Command(s) completed successfully.
EXECUTE('bulk insert CHANNELS from '''+@DATADIR+'\CHANNELS.txt''
With (firstrow = 2,
fieldterminator=''|'',
KEEPNULLS,
rowterminator=''\n'',
MAXERRORS = 10000)
')
msg:Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@DATADIR".
I am using SQL2012.