Updating once deployed

吃可爱长大的小学妹 提交于 2019-12-14 03:14:52

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/29961907/updating-once-deployed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!