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
 SQL Server Administration (2005)
 AutoMagic Table Creation with SP and DBCC

Author  Topic 

dbthj
Posting Yak Master

143 Posts

Posted - 2010-06-04 : 13:03:33
SQL has provided us a magic tool for creating a table from
query results, using the form,

select cola, colb, colc, cold
into #abc123
from schema.tbname

That's very handy. Now, Here's my question:
Many Stored Procedures and DBCC commands return table results.
There ought to be a way to automagically get a table created
to hold the results without issuing a CREATE TABLE statement,
listing all the columns and their data types.

Is there a way to do that?
   

- Advertisement -