| Author |
Topic |
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-19 : 02:54:47
|
| Hi,I am working in sqlserver2008When i try to execute my stored procedure which has single select statement it provides two result sets.1st resultset will be output of my query written in the procedure. 2nd wil be return value shows as 0.how to avoid the second result set . if i excute my procedure it should give the result set for the query wriiten under that . So please help me in this. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-19 : 03:00:50
|
can you show us how your stored procedure looks like and how do you execute it KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-19 : 03:12:39
|
| Here is my procedure : CREATE PROCEDURE SampleProc ASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT * from sampleENDWhen i execute this using execute option in sqlserver IDE it produces two results sets with the follwoing codeUSE [Check]GODECLARE @return_value intEXEC @return_value = [dbo].[SampleProc]SELECT 'Return Value' = @return_valueGOExec So how to avoid the second result set . please help me |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-19 : 03:16:22
|
quote: So how to avoid the second result set . please help me
the 1st result is from the Stored Procedure, the 2nd result is from the SELECT statement of "Return Value"USE [Check]GODECLARE @return_value intEXEC @return_value = [dbo].[SampleProc]SELECT 'Return Value' = @return_value KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-19 : 03:18:53
|
| The below code is auto generated code when i try to excecute the produre using Execute stored procedure option in the IDE.USE [Check]GODECLARE @return_value intEXEC @return_value = [dbo].[SampleProc]SELECT 'Return Value' = @return_valueHow to supress the return value. please help me |
 |
|
|
raghuveer125
Constraint Violating Yak Guru
285 Posts |
Posted - 2011-04-19 : 03:28:28
|
| Hey if this is having only one column then try thisDeclare @return_Value intDeclare @t Table (col int)insert into @t exec SampleProc --This is your spSelect @return_Value=col from @tselect @return_ValueRaghu' S |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-19 : 03:34:25
|
| Hi Is there any option to supress the return value when executing the procedure using "Execute stored procedure" option in the object explorer of sqlserver |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-19 : 03:42:43
|
quote: Originally posted by sqllover Hi Is there any option to supress the return value when executing the procedure using "Execute stored procedure" option in the object explorer of sqlserver
Why is this even a concern or issue ? This is just how SSMS behave KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-19 : 04:42:03
|
| Thanks Kthan. But i am just wondering is there any option to supress.If you have any idea please share with me |
 |
|
|
|