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)
 Script a temporary table?

Author  Topic 

ferrethouse
Constraint Violating Yak Guru

352 Posts

Posted - 2010-06-18 : 23:14:33
Is it possible to generate a CREATE script for a temporary table?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-06-18 : 23:28:22
I don't want to say "no" because you might be able to do it using SMO objects via OLE automation (sp_OA procedures), but I highly doubt it.

You can query tempdb.INFORMATION_SCHEMA.COLUMNS to get column information on the temp table. You can then use that to create a script, but it has to be done in the same session in which the temp table was created, so it's somewhat pointless.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-19 : 04:34:33
Might help to know the problem you are trying to solve?
Go to Top of Page
   

- Advertisement -