[英]Deploy Sql Server in .NET using my application
I have winforms application in my company to deploy applications in several environments (Development, PreProduction, Production). 我公司中有winforms应用程序,可以在多个环境(开发,预生产,生产)中部署应用程序。
Now, I want to include a new functionality: 现在,我想包括一个新功能:
I need to deploy SQL Server scripts in environments: development, preproduction and production. 我需要在以下环境中部署SQL Server脚本:开发,预生产和生产。
My application will run directly in these environments. 我的应用程序将直接在这些环境中运行。 I do not want to install Visual Studio in such environments. 我不想在这样的环境中安装Visual Studio。 People with responsibility for the execution of the application and deployment do not know Visual Studio. 负责执行应用程序和部署的人员不了解Visual Studio。
We need, also required is a good detailed error handling, of the execution of the sql scripts. 我们还需要对sql脚本执行进行良好的详细错误处理。
Therefore, I need source code or libraries, API, etctera, that I can use as references in my project csproj. 因此,我需要源代码或库,API等,可以在我的项目csproj中用作参考。 The ultimate goal is to deploy scripts sql server 2005 最终目标是部署脚本sql server 2005
Please, any sample source code, APIs, tools, ideas , I ask for help gurus, MVPs, anyone... 请提供任何示例源代码,API,工具,想法,我要求帮助专家,MVP,任何人...
UPDATE: the environments are machines with Windows 2003, IIS 6.0. 更新:环境是装有Windows 2003,IIS 6.0的计算机。
Should 'Hi', 'thanks' and taglines and salutations be removed from posts? 是否应从帖子中删除“嗨”,“感谢”,标语和称呼? https://meta.stackexchange.com/questions/2950/should-hi-thanks-and-taglines-and-salutations-be-removed-from-posts https://meta.stackexchange.com/questions/2950/should-hi-thanks-and-taglines-and-salutations-be-removed-from-posts
I'm not sure what version of SQL Server you're using and also if you mean you want your application to create the database for you. 我不确定您使用的是哪个版本的SQL Server,也不确定您是否要让应用程序为您创建数据库。
However, check out the SQL Publishing Wizard (depending on the versions of apps you're using). 但是,请签出“ SQL发布向导” (取决于您使用的应用程序的版本)。 The output script can be run by using the command-line osql command included with SQL Server or better via SQL Management Studio. 可以使用SQL Server附带的命令行osql命令运行输出脚本,也可以通过SQL Management Studio更好地运行该脚本。
Try DBSourceTools. 尝试使用DBSourceTools。 http://dbsourcetools.codeplex.com http://dbsourcetools.codeplex.com
Its open source, and specifically designed to script an entire database - tables, views, procs to disk, and then re-create that database through a deployment target. 它是开源的,专门用于编写整个数据库的脚本-表,视图,proc到磁盘,然后通过部署目标重新创建该数据库。
Once you have a deployment target, you can simply create a zip file for distribution. 一旦有了部署目标,就可以简单地创建一个zip文件进行分发。
Copy this zip file to your environment, un-zip it, and run the batch file. 将此zip文件复制到您的环境中,将其解压缩,然后运行批处理文件。
Have fun. 玩得开心。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.