- Posted by justin on December 12, 2004
Ran across this today. In Enterprise Manager from the Tables listing, hit Ctrl+C on a table name and then go to a text editor and hit Ctrl+V and get the appropriate
CREATE TABLE SQL syntax for the “copied” table (which includes constraints). Prior to this, when I've needed a table's T-SQL definition I've always right-clicked on the table name, gone to All Tasks and then selected Generate SQL Scripts. This latter approach affords more options (such as scripting multiple database entities, scripting dependent objects, adding
DROP statements, etc.), but the simple “copy-paste” technique is a fast way to just grab the create script for a single table. (This handy shortcut works for stored procedures, too!)