Oct 24, 2002 #1 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
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
Oct 24, 2002 #2 JJayUK Programmer Dec 18, 2001 57 GB 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 Upvote 0 Downvote
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
Oct 24, 2002 Thread starter #3 sarav2k Technical User Oct 22, 2002 42 US 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 Upvote 0 Downvote
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