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)
 [RESOLVED] Accessing Procedure Results

Author  Topic 

slaws
Starting Member

9 Posts

Posted - 2007-06-20 : 10:05:15
Hey everyone,

Is there a way to write the results of a stored procedure to a table?

I have a procedure that launches an SSIS package using the exec master..xp_cmdshell command. Everything runs fine and the results of the process are listed in a table format when finished. The problem is that when I launch the procedure remotely from an application I have no idea whether the procedure succeeded or failed.

Any ideas? Thanks in advance for your help.

Scott

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-20 : 10:09:22
You can create table to match the format of the resultset returned and use
INSERT INTO Table EXEC sp-name
command to store the results to a table.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-20 : 10:10:30
Create table #temp(col1 ........)

Insert into #temp
EXEC your+procedure

Select columns from #temp

Note that the structure of #temp should be identical to the result returned by procedure

Madhivanan

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

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-20 : 10:11:04


Madhivanan

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

slaws
Starting Member

9 Posts

Posted - 2007-06-20 : 10:17:16
Awesome, Thanks for the replies

Scott
Go to Top of Page
   

- Advertisement -