1. <legend id='QuHMc'><style id='QuHMc'><dir id='QuHMc'><q id='QuHMc'></q></dir></style></legend>
        <i id='QuHMc'><tr id='QuHMc'><dt id='QuHMc'><q id='QuHMc'><span id='QuHMc'><b id='QuHMc'><form id='QuHMc'><ins id='QuHMc'></ins><ul id='QuHMc'></ul><sub id='QuHMc'></sub></form><legend id='QuHMc'></legend><bdo id='QuHMc'><pre id='QuHMc'><center id='QuHMc'></center></pre></bdo></b><th id='QuHMc'></th></span></q></dt></tr></i><div id='QuHMc'><tfoot id='QuHMc'></tfoot><dl id='QuHMc'><fieldset id='QuHMc'></fieldset></dl></div>

        <small id='QuHMc'></small><noframes id='QuHMc'>

        <tfoot id='QuHMc'></tfoot>
          <bdo id='QuHMc'></bdo><ul id='QuHMc'></ul>

        如何自动化“生成脚本"?SQL Server Management Studio 2008 中的任务?

        How can I automate the quot;generate scriptsquot; task in SQL Server Management Studio 2008?(如何自动化“生成脚本?SQL Server Management Studio 2008 中的任务?)

              <bdo id='TFDNp'></bdo><ul id='TFDNp'></ul>
              <legend id='TFDNp'><style id='TFDNp'><dir id='TFDNp'><q id='TFDNp'></q></dir></style></legend>
                <tbody id='TFDNp'></tbody>

              <small id='TFDNp'></small><noframes id='TFDNp'>

              <tfoot id='TFDNp'></tfoot>
              <i id='TFDNp'><tr id='TFDNp'><dt id='TFDNp'><q id='TFDNp'><span id='TFDNp'><b id='TFDNp'><form id='TFDNp'><ins id='TFDNp'></ins><ul id='TFDNp'></ul><sub id='TFDNp'></sub></form><legend id='TFDNp'></legend><bdo id='TFDNp'><pre id='TFDNp'><center id='TFDNp'></center></pre></bdo></b><th id='TFDNp'></th></span></q></dt></tr></i><div id='TFDNp'><tfoot id='TFDNp'></tfoot><dl id='TFDNp'><fieldset id='TFDNp'></fieldset></dl></div>

                  本文介绍了如何自动化“生成脚本"?SQL Server Management Studio 2008 中的任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在 SQL Server Management Studio 2008 中自动生成脚本.

                  I'd like to automate the script generation in SQL Server Management Studio 2008.

                  现在我要做的是:

                  • 右键单击我的数据库,任务,生成脚本..."
                  • 手动选择我需要的所有导出选项,然后在选择对象"选项卡上点击全选
                  • 选择导出文件夹
                  • 最终点击完成"按钮

                  有没有办法让这个任务自动化?

                  Is there a way to automate this task?

                  我想生成创建脚本,而不是更改脚本.

                  Edit : I want to generate creation scripts, not change scripts.

                  推荐答案

                  Brann 在 Visual Studio 2008 SP1 团队套件中提到的是数据库发布向导的 1.4 版.它与 sql server 2008(可能只是专业版?)一起安装到 Program FilesMicrosoft SQL Server90ToolsPublishing1.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 FilesMicrosoft SQL Server90ToolsPublishing1.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 相同的麻烦(用户转换为角色,约束没有按正确的顺序创建),但这对我来说不是解决方案,因为它没有't 脚本对象到不同的文件,就像 SSMS 中的 Tasks->Generate Scripts 选项一样.我目前正在使用 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 最初发布在 Bill Graziano 的博客上,但随后由 Bill 发布到 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.codeplex.com/

                  我已经开始使用 RedGate 的 SQL 比较产品来做到这一点.它是 sql 发布向导本应具备的所有功能的非常好的替代品.您选择一个数据库、备份或快照作为源,并选择一个文件夹作为输出位置,它会将所有内容很好地转储到文件夹结构中.它恰好与他们的其他产品 SQL Source Control 使用的格式相同.

                  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.

                  这篇关于如何自动化“生成脚本"?SQL Server Management Studio 2008 中的任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Building a comma separated list?(建立一个逗号分隔的列表?)
                  Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column(尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误)
                  How can I import an Excel file into SQL Server?(如何将 Excel 文件导入 SQL Server?)
                  Export table to file with column headers (column names) using the bcp utility and SQL Server 2008(使用 bcp 实用程序和 SQL Server 2008 将表导出到带有列标题(列名称)的文件)
                  Concat field value to string in SQL Server(将字段值连接到 SQL Server 中的字符串)
                  SQL Server Bulk insert of CSV file with inconsistent quotes(SQL Server 批量插入带有不一致引号的 CSV 文件)
                    <bdo id='ihsIr'></bdo><ul id='ihsIr'></ul>

                        <tfoot id='ihsIr'></tfoot>
                      • <legend id='ihsIr'><style id='ihsIr'><dir id='ihsIr'><q id='ihsIr'></q></dir></style></legend>

                          <tbody id='ihsIr'></tbody>
                      • <i id='ihsIr'><tr id='ihsIr'><dt id='ihsIr'><q id='ihsIr'><span id='ihsIr'><b id='ihsIr'><form id='ihsIr'><ins id='ihsIr'></ins><ul id='ihsIr'></ul><sub id='ihsIr'></sub></form><legend id='ihsIr'></legend><bdo id='ihsIr'><pre id='ihsIr'><center id='ihsIr'></center></pre></bdo></b><th id='ihsIr'></th></span></q></dt></tr></i><div id='ihsIr'><tfoot id='ihsIr'></tfoot><dl id='ihsIr'><fieldset id='ihsIr'></fieldset></dl></div>

                        <small id='ihsIr'></small><noframes id='ihsIr'>