16 September 2005

Scripting Database Objects

DBAzine.com: Scripting Database Objects have some very good advice on command line Sql Server database objects (tables, index, store procedures etc) scripting. This is extremely useful on automated build process using NAnt. Basically you can run this command to generate db objects except database itself.
The script is created by executed this command:


C:\Program Files\Microsoft SQL Server\MSSQL\Upgrade>scptxfr.exe /s /d /I /f DBExtract.sql /q /r /H /Y

Then concatenate it with the 'standard' database drop and creation script produced with Enterprise Manager - All Tasks - Generate SQL Script (with only script database option)

No comments: