Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesUsing Query Analyzer, I can right click on an object and select "script object to new window as create" and I get the text of the object's definition (schema). Can I get same result from command line, i.e., from osql, I can get text output for the definition of the object (something like defncopy under Sybase)? If so, what is the command or store procedure name? Thanks in advance.
Post Follow-up to this messageUnfortunately not. You can look at scptxfr.exe (it's installed with MSSQL server - run it with /? to see the options), which is a command-line tool used during an upgrade process. But it's not documented, and it doesn't give you the same flexibility as the QA/EM scripting fucntionality. The best general solution is probably to write your own scripts using the SQLDMO COM interface, which exposes .Script methods for all MSSQL objects - the details are in Books Online. Or there are plenty of third-party tools to do this as well. Simon
Post Follow-up to this messageHi Dav, Take a look at this sample. I guess this helps you. It is really good. http://www.databasejournal.com/feat...10894_3401081_1 Thank you Raju
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread