|
Home > Archive > Microsoft SQL Server forum > April 2005 > command line
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Using 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.
| |
| Simon Hayes 2005-04-21, 7:23 am |
| Unfortunately 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
| |
|
|
|
|
|