Is it possible to make SQLCMD Mode 'Sticky' in Database Projects

余生颓废 提交于 2019-11-29 11:00:39

问题


I have a database project in Visual Studio 2013, with a post deployment script that uses SQLCMD mode.

The problem I am having is that the project defaults to non-SQLCMD mode every time the project is opened. This means that every time the project is opened, the Error List will be flooded with errors like "Incorrect syntax near ':'." until the developer opens the deployment script and clicks the SQLCMD Mode button.

Is there a way to default to keeping SQLCMD Mode on so developers don't have to do this each time they open the project?


回答1:


Had to dig a little for this one:

Go to the Tools|Options menu, then expand to SQL Server Tools, Transact-SQL editor, Query Execution. There's a setting in there to click that says "By default, open new queries in SQLCMD mode".

However, this shouldn't throw any errors/warnings unless you have that particular script open unless there's something new in VS2013 that changes that behavior.

This looks like a local option so would need to be set for each developer.



来源:https://stackoverflow.com/questions/22057776/is-it-possible-to-make-sqlcmd-mode-sticky-in-database-projects

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