Version 0.16 of SMOscript includes an option to script just a single object.
Using the option -o [schema.]name
, one can reduce the output of SMOscript to an object matching the name, or schema.name combination. All child objects (triggers, constraints) will be included.
This feature has been requested recently.
The complete set of parameters of SMOscript looks like this:
smoscript 0.16.3665.39354 (c) by devio.at 2008-2010 list and script databases and database objects. usage: smoscript [options] [command] options: (leading '-' or '/') -s server server name -d database database name -o [schema.]object object name -u username username (default: integrated authentication) -p password password (if -u is missing, password for sa) -r generate DROP statements -i include IF NOT EXISTS statements -f filename output to file -F directory output to directory -A current ANSI codepage -O ASCII -T Unicode -U UTF8 commands: l list databases on server (implied by -s) list objects in database (implied by -s -d) s script all objects (implied by -s -d -F/-f) script single object (implied by -s -d -o) db list database properties
The lastest version of SMOscript is available for download here.