且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除列时Visual Studio数据库项目问题

更新时间:2022-12-31 10:59:16

嗨Jurgen,

Hi Jurgen,

 

为此,您将使用预部署脚本。 项目有一个前后部署脚本,您可以将自定义T-SQL添加到其他脚本或包含其他脚本。 在您的方案中,我会检查以确定列是否存在,如果存在,请将
数据移至临时表。 然后,您可以使用后部署脚本来处理您认为合适的数据。

For this you would use the pre-deployment script.  Projects have a pre and post deployment script which you can add custom T-SQL to or include other scripts.  In your scenario I would put a check to determine if the column exists and if so, move the data to temp table.  You then can use the post deployment script to process the data as you see fit.

谢谢,