views:

45

answers:

2

Hi all,

I have a storedproc which has multiple select statement. When it is executed in sql server , it returns multiple tables.

I need a query which will select a particular table from the storedproc e.g. sp_help.

Please help.

+1  A: 

If i have a look at this link, it seems that it is not possible.

astander
A: 

Astander is right. From the number of tables available in ur SP, it is not possible directly.

However, you can apply some trick to accomplish your work. I am giving an example here. May be you can generate some idea based on this line.

SELECT * FROM sys.Tables where name = 'my_tbl'

As you can make out that I am filtering out the query by a table among all the tables available in my database.

Something of this sort may help you.

Else, if can get the dataset and then from that get the needed datatable from ur frontend code.

priyanka.sarkar