1

I have created database project in visual studio 2013. Project build successfully . In this project I have inserted some test data in post deployment. If any data failed to insert then how can know the one of script is failed at particular location.

Actually I want to rollback all the thing if any command is failed from script file itself. Since SQL Server 2012 is not supporting rollback from pre/post deployment script.

4

1 回答 1

1

结果窗口将为您提供任何错误的行和详细信息,这有点烦人,因为它有时会显示脚本开头的文本但错误行号是正确的。

您应该做的一般事情是确保您的插入脚本可重新运行,然后如果您真的看不到错误,您可以自己运行脚本来调试它。

我真的建议使用 MERGE 语句进行插入:)

我通常还建议使用 sqlpackage.exe 推送到本地 Deb 实例而不是 vs 发布,请参阅:

https://the.agilesql.club/blog/Ed-Elliott/Visual-Studio-SSDT-Publish-My-Personal-Best-Practices

埃德

于 2015-08-19T06:36:10.600 回答