Author |
Topic |
dije
Starting Member
6 Posts |
Posted - 2011-09-15 : 22:47:08
|
Dear All,Here the situation :1. DECLARE @RC int EXEC @RC=t1_INSERT 1,1 SELECT @RC AS [RC_Parent]2. DECLARE @RC int DECLARE @SQL nvarchar(500) SET @SQL=N't1_INSERT 1,1' SET @RC=0 EXEC @RC=sp_executesql @SQL SELECT @RC AS [RC_Parent]on scheme No. #1, i can get value from variable @RC (Return Code).on scheme No. #2, variable @RC always return 0...???what should i do to get @RC value on scheme #2...??thx All, |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
dije
Starting Member
6 Posts |
Posted - 2011-09-15 : 23:05:58
|
thank's tara...i used SQL 2000, i can't find OUTPUT option of sp_executesql... |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-09-15 : 23:41:28
|
[code]DECLARE @RC intDECLARE @SQL nvarchar(500)SET @SQL=N'EXEC @RC=t1_INSERT 1,1'SET @RC=0EXEC sp_executesql @SQL, N'@RC int OUTPUT', @RC OUTPUTSELECT @RC AS [RC_Parent][/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
dije
Starting Member
6 Posts |
Posted - 2011-09-15 : 23:47:11
|
Dear tkzer & khtan,It's work..!!!thx a lot... |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-09-16 : 01:19:59
|
you mean the OUTPUT option ?Just check the SQL 2000 BOL, it is not stated at all. And I have been using sp_executesql with OUTPUT parameter on SQL 2000 for ages and didn't realize this KH[spoiler]Time is always against us[/spoiler] |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|