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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 stored procedure execeution

Author  Topic 

tuzijatek
Starting Member

2 Posts

Posted - 2009-08-23 : 11:17:03
Hi All!

I would like to do a stored procedure like

DECLARE @key NVARCHAR(200)
EXEC myproc @input='blabla', @output=@key OUTPUT
SELECT * FROM mytable WHERE id=@key

The problem is that the execution of this procedure gives back 2 recordsets. The first gives the value of @val, the second gives the result of the select. Is there a way do this task, that gives back only the second recordset? In other words, how to give value to a variable through a stored procedure that does not produce a recordset?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-02 : 06:59:04
I dont think there is a way to get second recordset using sql. You can do this via front end application

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 08:38:18
sorry your question is not clear. so you want to suppress resultset and get only variable value?
Go to Top of Page

tuzijatek
Starting Member

2 Posts

Posted - 2009-09-03 : 06:30:09
mandhivanan,
the problem is that I dont want the "EXEC myproc ..." to give a result recordset, instead I want it to act
something like: SET @key=.... statement.

visakh16,
Yes, exactly!
Go to Top of Page
   

- Advertisement -