Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

returning data from sys SP

Status
Not open for further replies.

sarav2k

Technical User
Oct 22, 2002
42
US
Hi
I would like to execute system stored procedure(eg. sp_columns)from another stored procedure and want to get the record set for analysis.

will cursor be useful for this? How to do it?

Thanks in advance
sarav


 
Most system stored procedures that return recordsets can be invoked as part of an INSERT statement.

CREATE TABLE #DATA (
DATA CHAR(500) )

INSERT #DATA
EXEC master..xp_cmdshell('DIR *.*')

Will load the results of the DIR *.* operation into the table called #DATA.

I don't see why you cannot do this with the other ones as long as they provide output.

Hope this helps Regards,
JJayUK
 
JJayUK...
It is giving output.... but Now my question is.
Do we need to create the temp table with all the columns to match the executed SP?

Is that only way ? or Any other way?

Thanks
Sarav2k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top