使SQL Intellisense知道当前数据库 [英] Make SQL Intellisense know the current database

查看:105
本文介绍了使SQL Intellisense知道当前数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使SQL Server Managment Studio Intellisense知道当前正在使用的数据库是什么,即我希望能够执行以下操作

How do I make SQL Server Managment Studio Intellisense know what is the current database in use, i.e. I want to be able to do the following

SELECT * FROM Table 

代替

SELECT * FROM DatabaseName.dbo.Table

具有智能感知能力.

更新

只需确认,我已经选择了当前数据库,即我的左下角没有显示主数据库.

Just confirm, I already had the currentdatabase selected, i.e. I don't have master database shown in the bottom left corner.

推荐答案

有时会添加

Use DatabaseName
Go

在脚本文件的顶部执行该文件即可.除此之外,有关Aaron Bertrands答案的建议还提供了其他解决智能感知的方法.

To the top of your script file and executing it will do the job. Other than that, the suggetsions on Aaron Bertrands answer provide other ways to fix the intellisense.

这篇关于使SQL Intellisense知道当前数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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