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.
| Author |
Topic |
|
s_narayanan
Starting Member
3 Posts |
Posted - 2004-04-06 : 12:04:04
|
| Hi All,Is there a way in SQL Server to get the results out of a stored procedure into a table or cursor?Thanks in advanceNarayanan Sankaranarayanan |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-04-06 : 12:43:09
|
| insert into table(col_1, col_2, ...,col_n) exec storedproc |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
GunterKDR
Starting Member
5 Posts |
Posted - 2004-04-06 : 13:09:41
|
Yes.Declare a table, then insert into with an EXEC.Something like:CREATE TABLE #myTable ( a int , b int )INSERT INTO #myTable EXEC MyProcJust make sure your column counts are the same, or specify the columns explicitly, as in:INSERT INTO #myTable ( a, b )EXEC MyProcquote: Originally posted by s_narayanan Hi All,Is there a way in SQL Server to get the results out of a stored procedure into a table or cursor?Thanks in advanceNarayanan Sankaranarayanan
They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin |
 |
|
|
|
|
|