Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 output of proc to executesql

Author  Topic 

pnpsql
Posting Yak Master

246 Posts

Posted - 2012-01-11 : 06:08:14
hi team ,
I need to use sp_executesql to execute a stored procedure and get output in output of sp_executesql

challenge everything

Kristen
Test

22859 Posts

Posted - 2012-01-11 : 06:41:24
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=170064
Go to Top of Page

biswajitdas
Starting Member

44 Posts

Posted - 2012-01-11 : 11:11:49
to enhance the knowledge also you can refer
http://support.microsoft.com/kb/262499


Sr Sql server DBA/Artitech
Go to Top of Page

pnpsql
Posting Yak Master

246 Posts

Posted - 2012-01-12 : 01:23:44
that helps me, but my problem is different, i have a sp that have 1 output parameter a need to exceute it via sp_executesql and get the inner sp output in sp_executesql output parameter..


challenge everything
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-01-12 : 01:47:44
quote:
Originally posted by pnpsql

that helps me, but my problem is different, i have a sp that have 1 output parameter a need to exceute it via sp_executesql and get the inner sp output in sp_executesql output parameter..

challenge everything



don't quite understand what you want here. Can you explain a bit more ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2012-01-12 : 03:41:28
Don't see how that is different, if I have understood:

DECLARE @MyOutputParameter int,
@SomeID int

SELECT @SomeID = 1234

EXEC sp_ExecuteSQL N'EXEC MySproc @SomeID, @MyOutputParameter OUTPUT',
N'@MyOutputParameter int OUTPUT, @SomeID int',
@MyOutputParameter = @MyOutputParameter OUTPUT,
@SomeID = @SomeID

SELECT [@MyOutputParameter]=@MyOutputParameter
Go to Top of Page
   

- Advertisement -