部署后更新 [英] Updating once deployed

查看:119
本文介绍了部署后更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我到处搜索过,但是没有找到简单的答案.

我已经部署了WinForms C#.NET应用程序,该应用程序使用LocalDb SQL Server 2012 Express数据库.因此,数据库是项目中包含的数据文件.我想在一些表中添加一些列,并且由于该项目是在许多客户端上部署的,所以我想向他们发送脚本或某种文件,一旦他们运行它,他们的数据库就会进行这些更改.

这怎么办?没有SQL Management Studio,因此用户无法在其中登录和运行脚本.我需要基于LocalDb来运行它,并且无法在线找到任何解决方案

解决方案

我将考虑执行sql脚本的批处理文件,如下所示:

sqlcmd -S <ComputerName>\<InstanceName> -i C:\Temp\ClearTables.sql

这篇文章提供了一个很好的答案. /p>

I have searched everywhere, however have not found a straightforward answer.

I have deployed a WinForms C# .NET application, which uses a LocalDb SQL Server 2012 Express database. The database is thus a data file contained in the project. I would like to add some columns to a number of tables, and since the project is deployed at a lot of clients, I would like to send them a script, or a file of some sort, and once they run it, their database would have these changes.

How can this be done? There is no SQL Management Studio, so the users cannot login and run a script in there. I need it to be run based on the LocalDb, and cannot find any solutions online

解决方案

I would consider a batch file that executes sql scripts, like so:

sqlcmd -S <ComputerName>\<InstanceName> -i C:\Temp\ClearTables.sql

This article provides a fairly good answer.

这篇关于部署后更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆