February 10, 2004 at 8:06 pm
Are there any system stored procedures that would allow you to simply type the name of any table from a DB and have it auto generate a Create Table Script as well as include any table dependencies in SQL Query Analyzer? Like user permissions etc.
February 12, 2004 at 2:21 am
This functionality is built into Enterprise Manager - right click on the table you want, select ALL TASKS then GENERATE SQL SCRIPT. Go to the OPTIONS tab for settings relating to scripting indexes, keys, triggers, user permissions etc etc
February 12, 2004 at 9:22 pm
I know how to do it that way I can also do the same thing in QA, however I'm trying to create an application that will allow users to simply type in the table name and have a script that automatically creates the create table script using SQL. That’s why I wasn't sure if there were any system stored procedures or something that would allow me to create the script just by referencing the table name
February 13, 2004 at 2:17 am
You could write your own stored proc using system stored proc sp_columns to return list of cols and datatypes for the table, then build up script string from there.
May 2, 2007 at 9:32 am
I'm interested if you found a script for that, if not I'm interested to collaborate to make one
May 3, 2007 at 7:37 pm
No, but press the {f8} key in query anlyzer to reveal the "tree"... drill down to the table you want, right click on it, and read the menu that appears... might want to setup "Scripting Options" from the same place to include some of those things you mentioned...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply