Home All Groups Group Topic Archive Search About
Author
30 Jul 2005 3:59 PM
Zachary Hartnett
I know how to get the text for various database objects (like stored
procedures) using sp_helptext or through direct access to the syscomments
table. One thing I have not been able to find is the text associated with
creating a table.

Are programs that dynamically display create and alter text for tables in a
database dynamically recreating the text based upon the names and existance
of columns, defaults, triggers, etc. or is there a way to see the actual
text used to create a table?

Thanks in advance for any advice you might have!

Author
30 Jul 2005 5:17 PM
Narayana Vyas Kondreddi
You could get CREATE TABLE script using Enterprise Manager's scripting
functionality.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/


Show quote
"Zachary Hartnett" <NoSpamPlease@NoThanks.no> wrote in message
news:%23arqf%23RlFHA.3568@TK2MSFTNGP10.phx.gbl...
>I know how to get the text for various database objects (like stored
>procedures) using sp_helptext or through direct access to the syscomments
>table. One thing I have not been able to find is the text associated with
>creating a table.
>
> Are programs that dynamically display create and alter text for tables in
> a database dynamically recreating the text based upon the names and
> existance of columns, defaults, triggers, etc. or is there a way to see
> the actual text used to create a table?
>
> Thanks in advance for any advice you might have!
>
Author
30 Jul 2005 5:50 PM
John Bell
Hi

Check out SQL-DMO in books online and the sample.

This may also help http://www.nigelrivett.net/DMOScriptAllDatabases.html

John

Show quote
"Zachary Hartnett" <NoSpamPlease@NoThanks.no> wrote in message
news:%23arqf%23RlFHA.3568@TK2MSFTNGP10.phx.gbl...
>I know how to get the text for various database objects (like stored
>procedures) using sp_helptext or through direct access to the syscomments
>table. One thing I have not been able to find is the text associated with
>creating a table.
>
> Are programs that dynamically display create and alter text for tables in
> a database dynamically recreating the text based upon the names and
> existance of columns, defaults, triggers, etc. or is there a way to see
> the actual text used to create a table?
>
> Thanks in advance for any advice you might have!
>

AddThis Social Bookmark Button