是否可以在数据库项目中使 SQLCMD 模式“粘性" [英] Is it possible to make SQLCMD Mode 'Sticky' in Database Projects

查看:22
本文介绍了是否可以在数据库项目中使 SQLCMD 模式“粘性"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2013 中有一个数据库项目,有一个使用 SQLCMD 模式的部署后脚本.

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

我遇到的问题是每次打开项目时项目默认为非 SQLCMD 模式.这意味着每次打开项目时,错误列表都会充斥着诸如':'附近的语法不正确"之类的错误.直到开发者打开部署脚本并点击 SQLCMD 模式按钮.

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.

有没有办法默认保持 SQLCMD 模式打开,这样开发人员每次打开项目时都不必这样做?

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?

推荐答案

不得不为此挖一点:

转到工具|选项菜单,然后展开到 SQL Server 工具、Transact-SQL 编辑器、查询执行.那里有一个设置可以点击,上面写着默认情况下,在 SQLCMD 模式下打开新查询".

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".

但是,除非 VS2013 中有一些新的东西改变了这种行为,否则这不应该抛出任何错误/警告,除非你打开了那个特定的脚本.

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.

这篇关于是否可以在数据库项目中使 SQLCMD 模式“粘性"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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