简体   繁体   English

使用我的应用程序在.NET中部署Sql Server

[英]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.

相关问题 如何使用应用程序部署.Net Compact Framework和SQL Server Compact Edition - How to deploy the .Net Compact Framework and SQL Server Compact Edition with the Application 如何将asp.net应用程序部署到我的服务器 - How to deploy an asp.net application to my server 与我的ASP.NET Web应用程序的多个SQL Server连接 - Multiple SQL Server connection to my ASP.NET web application 如何通过Internet将.net应用程序连接到SQL Server - How to connect my .net application to SQL Server via internet 如何在客户端上使用 sql server 数据库部署应用程序 - How to deploy application with sql server database on clients 如何使用MS SQL Server数据库发布和部署Asp.net核心数据库优先应用程序 - How to publish and deploy an Asp.net Core Database first application with MS SQL Server Database 部署具有SQL Server依赖关系的Winform应用程序 - Deploy winform application with sql server dependency 如何部署“SQL Server Express + EF”应用程序 - How to Deploy “SQL Server Express + EF” Application 我可以像使用内置数据库一样使用桌面应用程序部署SQL Server Express吗? - Can I deploy SQL Server Express with my desktop application just like builtin database? 使用命令行部署.net应用程序 - Deploy .net application using command Line
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM