![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
It seems so simple; within a single Execute SQL Task, insert a new row into a log table and store the new Identity column value in a global variable. Yet I can't get it to work. I started with this: DTS pkg global variable: intLoadID (int) which I set to zero. Execute SQL Task: INSERT INTO tblDataload_Price_Load_Log (Division_Code, Price_Level ) VALUES('71', 900) SELECT @@IDENTITY Ok, maybe this will work: SELECT Load_ID FROM tblDataload_Price_Load_Log WHERE Load_ID = (SELECT @@IDENTITY) Now I have the value 'Load_ID' available in the Parameters column of the Output Parameters tab, but still no change; the global variable intLoadID stays at zero. What am I missing here? Thanks. dj |
#3
| |||
| |||
|
|
Hello dj, Have you thought about using a proc to do this? http://www.sqldts.com/default.aspx?234 Whilst not as simple it will work. Allan It seems so simple; within a single Execute SQL Task, insert a new row into a log table and store the new Identity column value in a global variable. Yet I can't get it to work. I started with this: DTS pkg global variable: intLoadID (int) which I set to zero. Execute SQL Task: INSERT INTO tblDataload_Price_Load_Log (Division_Code, Price_Level ) VALUES('71', 900) SELECT @@IDENTITY Ok, maybe this will work: SELECT Load_ID FROM tblDataload_Price_Load_Log WHERE Load_ID = (SELECT @@IDENTITY) Now I have the value 'Load_ID' available in the Parameters column of the Output Parameters tab, but still no change; the global variable intLoadID stays at zero. What am I missing here? Thanks. dj |
![]() |
| Thread Tools | |
| Display Modes | |
| |