SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


T-SQL to Export Table Structure to a script


T-SQL to Export Table Structure to a script

Author
Message
Lowell
Lowell
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67341 Visits: 40890
Comments posted to this topic are about the item T-SQL to Export Table Structure to a script

Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
adrishmallik
adrishmallik
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 6
replying on such an old discussion looks odd, but i just can't hold my hands.. ;-)
you missed the computed column definition and extended properties, isn't it?

though i haven't yet run ur sp, but going thru the code i couldn't find anything regarding those two things.
i too have tried my hand on dis a bit. only sp_help gives the computed type column, but it doesn't give the expression for the column; i.e. on which column it gets calculated etc.

let me know if you find anything...
Lowell
Lowell
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67341 Visits: 40890
adrish sorry about the late followup; the forum doesn't seem to notify the author for posts on content the way it does for forum threads.

since this version got created, I've greatly enhanced some other versions of it;
these versions are much faster, and include everything: collation, cacvlulated columns, defaults, check constraints, triggers, you name it.

take a look at these:
Get DDL for any SQL 2000 Table http://www.sqlservercentral.com/Forums/Topic751784-566-1.aspx
Get DDL for any SQL 2005 Table http://www.sqlservercentral.com/Forums/Topic751783-566-1.aspx

Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search