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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-04-20 : 07:49:44
|
| Ramu writes "Hai all,Can you guys have idea how tocreate a table from a stored procedure.Like for egselect * into newtable from ... STORED PROCEDUREThanks,Ramu" |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-04-20 : 07:51:02
|
| you must be looking for function (udf)--------------------keeping it simple... |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-04-20 : 09:35:36
|
| You can't "select into" from an SP. However, you can create a table with the same structure as the SP output and insert. ie: insert myTable(<return col list from sp>) exec mySPOr what jen was saying, you can create a "table" function which is a user defined function that returns "table" rather than a single value and treat it just like you would a table.ie:select * into myNewTable from dbo.myUDFBe One with the OptimizerTG |
 |
|
|
|
|
|