ssis - execute sql task error -


an execute sql task has been defined below.the parameter mapping system:username input varchar 0 -1 system:packagename input varchar 1 -1

declare @dataloaderusername varchar(100) declare @packagename varchar(100) declare @code varchar(5) declare @runnumber int  set @dataloaderusername = ? set @packagename = ? set @code = 'bbb'   insert tbl_log (loaddatetime,dataloaderusername,packagename,code) select getdate(),@dataloaderusername,@packagename ,@code  select @runnumber = max(runnumber)  tbl_log  select @runnumber loadid 

it shows error

execute sql task] error: executing query "declare @dataloaderusername varchar(100) 

the same query executed in ssms , works fine(with hardcoded username)

put semi-colons @ end of each sql command. when ssis sends command sql server, sends single line, semi-colons needed show sql server each new command begins.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -