SMOscript: Scripting database objects using SMO

I created SMOscript a couple of months ago with the intention to make it a replacement for the SQL Server 2000 tool called scptxfr.

After installing SQL Server 2008 and AdventureWorks, I found that, besides some other shortcomings, SMOscript would not connect to an SQL Server 2008. Clearly time for an update!

The new version of SMOscript provides these improvements and new features:

The database dictionary is iterated faster by calling SetDefaultInitFields.

CREATE scripts now include child objects such as constraints and triggers as a result of SetDefaultInitFields.

SMOscript scripts all scriptable database objects as defined by SMO API. (The previous version only scripted tables, views, synonyms, stored procedures, and functions)

SMOscript now supports SQL Server 2008.

The latest version of SMOscript is available for download here.

Note: This is a command-line tool. You won’t see an icon under Start/Programs!

3 Responses to “SMOscript: Scripting database objects using SMO”

  1. Synching SQL Server Databases « devioblog Says:

    [...] lets you script all database objects that are scriptable through SMO. You can script the objects to a single file, or as single files in [...]

  2. Eric Cartman Says:

    Thanks for sharing your great program. I am having a problem on SQL 2008. When it encounters an encrypted stored procedure or access block on an object it stops processing the rest of the objects. The drop flag will find all the objects to drop but the create will not include objects after the error.

    “Error iterating objects: Script failed for StoredProcedure ‘dbo.xxx’.

    Is there a way to make the program continue even if there is an error like scptxfr can.

    From scptxfr help:
    /E – Stop scripting when error occurs.
    Default behavior is to log the error, and continue.

    Thanks
    Eric

  3. Scripting all MS SQL Databases using SMOscript « devioblog Says:

    [...] all MS SQL Databases using SMOscript SMOscript user Eric reported that the tool fails to script all remaining objects of a database once an error occurs trying to [...]

Leave a Reply