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 2000 Forums
 Transact-SQL (2000)
 Redirecting the procedure output to Table

Author  Topic 

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2005-06-20 : 10:39:39
Hello,

My procedure returns same values. i want to insert this values into same table. is there any way i can do that without using the variables.

Thanks

Complicated things can be done by simple thinking

Kristen
Test

22859 Posts

Posted - 2005-06-20 : 10:43:31
INSERT INTO MyTable (Col1, Col2, ...)
EXEC MySProc

Table must pre-exist (You can't do a SELECT * INTO MyNewTable FROM MyOldTable type deal)

Kristen
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-06-20 : 10:43:33
Is this what you mean?

insert myTable (<colList that matches SP output>)
exec mySP

Be One with the Optimizer
TG

oooh, by 2 seconds!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-06-20 : 10:45:46
Hehehe ... your <colList that matches SP output>) is invaluably info. though

Kristen
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2005-06-20 : 12:09:01
Thanks Kristen it helped

Complicated things can be done by simple thinking
Go to Top of Page
   

- Advertisement -