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

发布于 2024-09-10 04:11:35 字数 703 浏览 14 评论 0 原文

我的公司有 winforms 应用程序,可以在多个环境(开发、预生产、生产)中部署应用程序。

现在,我想包含一个新功能:

我需要在开发、预生产和生产环境中部署 SQL Server 脚本。

我的应用程序将直接在这些环境中运行。我不想在这样的环境中安装 Visual Studio。负责应用程序执行和部署的人员不了解 Visual Studio。

我们还需要对 sql 脚本的执行进行详细的错误处理。

因此,我需要源代码或库、API 等,我可以将其用作我的项目 csproj 中的参考。最终目标是部署脚本 sql server 2005

请提供任何示例源代码、API、工具、想法,我请求专家、MVP、任何人的帮助...

更新:环境是装有 Windows 2003、IIS 6.0 的计算机.

是否应该从帖子中删除“嗨”、“谢谢”以及标语和称呼? https://meta.stackexchange。 com/questions/2950/should-hi-thanks-and-taglines-and-salutations-be-removed-from-posts

I have winforms application in my company to deploy applications in several environments (Development, PreProduction, Production).

Now, I want to include a new functionality:

I need to deploy SQL Server scripts in environments: development, preproduction and production.

My application will run directly in these environments. I do not want to install Visual Studio in such environments. People with responsibility for the execution of the application and deployment do not know Visual Studio.

We need, also required is a good detailed error handling, of the execution of the sql scripts.

Therefore, I need source code or libraries, API, etctera, that I can use as references in my project csproj. The ultimate goal is to deploy scripts sql server 2005

Please, any sample source code, APIs, tools, ideas , I ask for help gurus, MVPs, anyone...

UPDATE: the environments are machines with 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

叹倦 2024-09-17 04:11:35

我不确定您使用的 SQL Server 版本是什么,也不知道您是否希望应用程序为您创建数据库。

但是,请查看 SQL发布向导(取决于您所使用的应用程序版本)。输出脚本可以使用 SQL Server 附带的命令行 osql 命令运行,也可以通过 SQL Management Studio 更好地运行。

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.

However, check out the SQL Publishing Wizard (depending on the versions of apps you're using). The output script can be run by using the command-line osql command included with SQL Server or better via SQL Management Studio.

塔塔猫 2024-09-17 04:11:35

尝试使用 DBSourceTools。 http://dbsourcetools.codeplex.com
它是开源的,专门设计用于编写整个数据库的脚本 - 表、视图、过程到磁盘,然后通过部署目标重新创建该数据库。
一旦您有了部署目标,您只需创建一个用于分发的 zip 文件即可。
将此 zip 文件复制到您的环境中,解压缩,然后运行批处理文件。
玩得开心。

Try DBSourceTools. 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.
Once you have a deployment target, you can simply create a zip file for distribution.
Copy this zip file to your environment, un-zip it, and run the batch file.
Have fun.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文