I added a couple of new options to my scripting tool SMOscript:
- The new -td command-line switch generates two files for tables: a [table].create.sql file containing the CREATE TABLE statement, and a [table].details.sql file containing the CREATE statements all table details (foreign keys, indexes, triggers), thus allowing recreating of a database schema without referential integrity problems
- The -o (object name) switch semantics has been extended to other commands than script
- The new -ol command-line switch implements a filter on object names similar to T-SQL LIKE. The filter is applied on the object name, and if not matching, on the combination “schema.objectname”.
The new command dd operates on data diagrams (see my previous post on SQL Server Data Diagrams):
- Using dd without parameters will list all data diagrams stored in the database.
- Using dd -o [diagram name] will list all tables contained in the data diagram, even tables that have been DROPped.
- Using dd -o [diagram name] -dt lists the DROPped tables only.
The latest version of SMOscript is available for download on my download website.