Automate Generate Scripts Wizard in SQL2008

旧城冷巷雨未停 提交于 2019-12-11 09:28:56

问题


Problem: how to automate a Generate Scripts in SQL2008 Management Studio:

ie right click on database, Tasks, Generate Scripts

All Tables All Stored Procs

Create drop statements Don't use USE statement Generate data

This is a 20sec process to do by hand.. needs automating :-) I don't really want to code it in C# in SQL Server Management Objects (SMO).

Maybe I'll have to use AutoHotKey :-)


回答1:


Use SMO - it's the right thing to do and you know it!




回答2:


Have a look at DBSourceTools. http://dbsourcetools.codeplex.com
It's an open-source scripting engine for SQL Server Databases that uses SMO.




回答3:


I've taken Will A's advice and tried scripting.. SQL Server Management Objects

nearly there :-)



来源:https://stackoverflow.com/questions/3380195/automate-generate-scripts-wizard-in-sql2008

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!