tsql - Automatic "Script database as... create" for SQL Server 2008 -
i'd make daily automatic creation of creation script database in sql server 2008, meaning having (bat, exe, ... whatever) creates text file same output obtained right-clicking on database in sql management studio , script database as... --> create to... --> new query window.
any hint?
thanks in advance,
mauro
edit 1: used smo couple of things annoying
- needs compatibility pack in sql server 2008 (confirm?)
- some things not created in script (some indexes , keys , in table creation schema lost)
best choice me powershell script other idea welcome!
you can use smo. example: http://www.sqlteam.com/article/scripting-database-objects-using-smo-updated (see scripting objects section).
more info on smo: http://msdn.microsoft.com/en-us/library/ms162169.aspx
Comments
Post a Comment