I would like to automate script generation (in SSMS –> Tasks –> Generate Scripts) in SSMS 2008. I have read that SQL Server 2008 does not support Database Publishing Wizard (including SQLPUBWIZ SCRIPT) but this automation can be done using SMO in SQL Server 2008. I don’t have a clue about SMO and how to do this using SMO, so could you give me some advice (resources etc.) how to begin?
I would like to automate script generation (in SSMS –> Tasks –> Generate Scripts)
Share
The key to SMO scripting is the
Scripterclass. All other tools (like SSMS) use this class to generated object creation scripts. There is an example usage on MSDN: