Home > Archive > MS SQL Server > August 2005 > creating DDL from a temporary table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author creating DDL from a temporary table
Abroit

2005-08-31, 11:23 am

I need to write a DDL Create script for a table in TempDb.

In Query Analyzer, I can see the table, but when I right click on the table
and attempt to script the Create I get a message telling that it could not
find the object in the collection (and it suggests I may want to use
qualifiers).

In Enterprise Manager, I can not see any user talbes in TempDb.

How do I get the scripts, ie, the DDL Create syntax....besides writing it
myself.

I have about 30 views which need to be changed to tables

Thaniks
Jens Süßmeyer

2005-08-31, 11:23 am

Materialize the table, then script it:

Select * INTO SomeMaterializedTabl
e
From #YourTempTable
Where 1= 2 --To have no rows, only the structure

--
HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---


"Abroit" wrote:

> I need to write a DDL Create script for a table in TempDb.
>
> In Query Analyzer, I can see the table, but when I right click on the table
> and attempt to script the Create I get a message telling that it could not
> find the object in the collection (and it suggests I may want to use
> qualifiers).
>
> In Enterprise Manager, I can not see any user talbes in TempDb.
>
> How do I get the scripts, ie, the DDL Create syntax....besides writing it
> myself.
>
> I have about 30 views which need to be changed to tables
>
> Thaniks

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com