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 2005 Forums
 Transact-SQL (2005)
 supressing output of stored procedure

Author  Topic 

Swati Jain
Posting Yak Master

139 Posts

Posted - 2009-01-19 : 12:57:22
Hello All..

The stored procedure returns the two resultsets as the outcome of 2 select quries written in stored

Procedure.I want to supress the first resultset(so that i will get only 1 resultset) ,though 2 select queries will be still in stored proc.

how i can do so?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-19 : 12:59:31
You can not suppress the output inside the stored procedure unless you remove the query. Ignore the first result set in your application code.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-19 : 13:00:06
if you dont want 1st resultset why retain it at all?
Go to Top of Page

Sudhindra
Starting Member

13 Posts

Posted - 2009-01-19 : 23:50:28
What exactly are you trying to achieve, if you can just highlight that it would be easy to analyze what needs to be done here. what are you doing with the first select query? are you using the result in the stored procedure?
Go to Top of Page

Swati Jain
Posting Yak Master

139 Posts

Posted - 2009-01-20 : 01:19:29
quote:
Originally posted by Sudhindra

What exactly are you trying to achieve, if you can just highlight that it would be easy to analyze what needs to be done here. what are you doing with the first select query? are you using the result in the stored procedure?



Hello All,

Actually I am using sharepoint dataform view .Dataformview is binded with stored procedure output.
As described in previous post.this SP has two select queries
first query gives the output values which are used in where clause of
second select query.

But when i bind this SP to dataformview I get only the output of first
query which i dnt want as i want the output of second select query
thts why i want to supress first select query output but as it gives the output values i cant remove it from SP.

Pls tell me workaround?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-20 : 02:16:40
quote:
Originally posted by Swati Jain

Pls tell me workaround?
Make a better design.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-01-20 : 02:17:15
quote:
Originally posted by Swati Jain

quote:
Originally posted by Sudhindra

What exactly are you trying to achieve, if you can just highlight that it would be easy to analyze what needs to be done here. what are you doing with the first select query? are you using the result in the stored procedure?



Hello All,

Actually I am using sharepoint dataform view .Dataformview is binded with stored procedure output.
As described in previous post.this SP has two select queries
first query gives the output values which are used in where clause of
second select query.

But when i bind this SP to dataformview I get only the output of first
query which i dnt want as i want the output of second select query
thts why i want to supress first select query output but as it gives the output values i cant remove it from SP.

Pls tell me workaround?



Post the code you used in the procedure. Probably you dont need a first select which is used inside the second select statement

Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-20 : 02:28:53
or make both the selects into a single query using union all with an extra field (say category). give value as 1 for 1st resultset & 2 for 2nd. then filter the applicaton on category=2 to get only second select. but for this you need to make sure both resultset contain same number of columns and also corresponding columns are of same type.
Go to Top of Page

ayamas
Aged Yak Warrior

552 Posts

Posted - 2009-01-20 : 02:29:58
How are you binding the output?With a datatable or a dataset?If dataset then you can do something like this.
Dataformview.Datasource=ds.Tables[1]
Dataformview.Databind()
With ds.Tables[1] the resultset of just the second select statement will get bound.
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-01-20 : 03:17:36
quote:
Originally posted by Swati Jain

quote:
Originally posted by Sudhindra

What exactly are you trying to achieve, if you can just highlight that it would be easy to analyze what needs to be done here. what are you doing with the first select query? are you using the result in the stored procedure?



Hello All,

Actually I am using sharepoint dataform view .Dataformview is binded with stored procedure output.
As described in previous post.this SP has two select queries
first query gives the output values which are used in where clause of
second select query.

But when i bind this SP to dataformview I get only the output of first
query which i dnt want as i want the output of second select query
thts why i want to supress first select query output but as it gives the output values i cant remove it from SP.

Pls tell me workaround?





Just Post Your SP.....

there r lots of people to help u out,,,
Thanks,,,,,,
Go to Top of Page
   

- Advertisement -