且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何可以自动"生成脚本"在SQL Server Management Studio 2008的任务是什么?

更新时间:2023-02-06 18:49:48

什么是布莱恩从Visual Studio 2008 SP1团队套件一提的是数据库发布向导1.4版本。它的安装与SQL Server 2008(也许只有专业?)到\\ Program Files文件\\ Microsoft SQL Server的\\ 90 \\ TOOLS \\发布\\ 1.4。从服务器资源管理器VS调用简单地调用此。您可以通过命令行实现同样的功能,例如:

What Brann is mentioning from the Visual Studio 2008 SP1 Team Suite is version 1.4 of the Database Publishing Wizard. It's installed with sql server 2008 (maybe only professional?) to \Program Files\Microsoft SQL Server\90\Tools\Publishing\1.4. The VS call from server explorer is simply calling this. You can achieve the same functionality via the command line like:

sqlpubwiz help script

我不知道是否V1.4具有V1.1做(用户转换为,不按正确的顺序创建的约束作用)相同的烦恼,但它不是一个解决方案,我,因为它不 ŧ脚本反对像任务 - 不同的文件>在生成脚本SSMS选项做。我目前使用Scriptio的修改版本(使用MS SMO API)作为一种改进更换为数据库发布向导(sqlpubwiz.exe)。这不是目前的命令行脚本的,我可能会在未来加入了贡献。

I don't know if v1.4 has the same troubles that v1.1 did (users are converted to roles, constraints are not created in the right order), but it is not a solution for me because it doesn't script objects to different files like the Tasks->Generate Scripts option in SSMS does. I'm currently using a modified version of Scriptio (uses the MS SMO API) to act as an improved replacement for the database publishing wizard (sqlpubwiz.exe). It's not currently scriptable from the command line, I might add that contribution in the future.

Scriptio最初发布于比尔格拉齐亚诺的博客,但其后已比尔他人发布codePLEX和更新。阅读讨论,看看如何编译与SQL Server 2008中使用。

Scriptio was originally posted on Bill Graziano's blog, but has subsequently been released to CodePlex by Bill and updated by others. Read the discussion to see how to compile for use with SQL Server 2008.

HTTP://scriptio.$c$cplex.com/

编辑:我已经使用展鹏的SQL比较产品要做到这一点,因为开始。这是一个非常好的替代所有SQL发布向导应有的水平。您可以选择一个数据库,备份或快照作为源,并且文件夹作为输出位置,它很好地转储一切都变成文件夹结构。这恰好是相同的格式,他们的其它产品,SQL源代码管理,使用。

I've since started using RedGate's SQL Compare product to do this. It's a very nice replacement for all that sql publishing wizard should have been. You choose a database, backup, or snapshot as the source, and a folder as the output location and it dumps everything nicely into a folder structure. It happens to be the same format that their other product, SQL Source Control, uses.