简体   繁体   English

IntelliSense 在 SQL Server Management Studio 中不工作

[英]IntelliSense is not working in SQL Server Management Studio

We use SQL Server Management Studio 2008 R2.我们使用 SQL Server Management Studio 2008 R2。 IntelliSense works with SA account perfectly. IntelliSense 与 SA 帐户完美配合。 But it is not working with Windows Authentication user.但它不适用于 Windows 身份验证用户。 The user has access master db with db_owner role but it's not sysadmin.用户可以访问具有 db_owner 角色的主数据库,但它不是系统管理员。

How do I fix this issue?我该如何解决这个问题?

You can try solution from these questions1 or questions2 and questions3 .您可以尝试从这些问题 1问题 2问题 3 中解决
Or please try these steps as below:或者请尝试以下步骤:

  • Enable IntelliSense:启用智能感知:
    • For all query windows, please go to Tools >> Options >> Text Editor >> Transact-SQL >> IntelliSense, and select Enable IntelliSense.对于所有查询窗口,请转到工具 >> 选项 >> 文本编辑器 >> Transact-SQL >> IntelliSense,然后选择启用 IntelliSense。
    • For each opening query window, please go to Query >> Intellisense Enabled.对于每个打开的查询窗口,请转到 Query >> Intellisense Enabled。
  • Enable statement completion: please go to Tools >> Options >> Text Editor >> Transact-SQL >> General, and check on Auto list members and Parameter information boxes.启用语句完成:请转到工具>>选项>>文本编辑器>>Transact-SQL>>常规,并选中自动列表成员和参数信息框。
  • Refresh IntelliSense local cache: please go to >> Edit >> IntelliSense >>Refresh Local Cache or use the CTRL+Shift+R keyboard shortcut to refresh.刷新 IntelliSense 本地缓存:请转到 >> 编辑 >> IntelliSense >> 刷新本地缓存或使用CTRL+Shift+R键盘快捷键进行刷新。
  • Wait a minute or two for the Refresh to finish before trying again.等待一两分钟让刷新完成,然后再试一次。

This may seem too short of an answer, but probably it's the solution to your Problem:这可能看起来太短了答案,但可能是您问题的解决方案:

CTRL + SHIFT + R CTRL + SHIFT + R

Also, I found this: Troubleshooting IntelliSense (SQL Server Management Studio)另外,我发现了这个: IntelliSense 故障排除(SQL Server Management Studio)

I had the same issue.我遇到过同样的问题。 Everything was enabled to ensure proper Intellisense functions, but didn't work.一切都已启用以确保正确的 Intellisense 功能,但没有奏效。 I realized I had SQLCMD mode enabled by default.我意识到我默认启用了 SQLCMD 模式。 Disabling it restored Intellisense functionality :)禁用它可以恢复 Intellisense 功能:)

增加工具、选项、文本编辑器、Transact-SQL、IntelliSense 下的最大脚本大小为我修复了 Intellisense。

Missing from other solutions, but fixed it for me:缺少其他解决方案,但为我修复了它:

Edit > IntelliSense > Toggle Completion Mode

or CTRL+ALT+SpaceCTRL+ALT+空格

Turning Query > SQLCMD Mode on and off again fixed the issue for me in SSMS 18.1, even though it was never enabled to begin with.在 SSMS 18.1 中再次打开和关闭查询 > SQLCMD 模式为我解决了这个问题,即使它从未启用过。

After trying all the answers here to no avail and giving up, I remained curious about the SQLCMD Mode mentioned in Chow Lover's answer.在尝试了这里的所有答案都无济于事并放弃之后,我仍然对 Chow Lover 的答案中提到的SQLCMD 模式感到好奇。 I turned it on to see what it did, but noticed no change so turned it off again.我打开它看看它做了什么,但发现没有任何变化,所以又把它关掉了。 Intellisense suddenly awoke and has been working fine since. Intellisense 突然醒来,从那以后一直工作正常。

My schemes were too big.我的计划太大了。 I had to do this:我不得不这样做:

Tools >> Options >> Text Editor >> Transact-SQL >> Intellisence工具 >> 选项 >> 文本编辑器 >> Transact-SQL >> Intellisence

Maximum script size: Unlimited最大脚本大小:无限制

I tried all the above/below suggestions... and nothing worked.我尝试了以上/以下的所有建议......但没有任何效果。

  • Going to options and toggling everything off and on didn't work .转到选项并关闭和打开所有内容都不起作用
  • Toggling SQLCMD didn't work切换 SQLCMD不起作用
  • Going to Edit > Intellisense and toggling everything off and on didn't work .转到Edit > Intellisense并关闭和打开所有内容都不起作用
  • Changing RAM and Cache size didn't work .更改 RAM 和缓存大小不起作用
  • I tried rebooting and that didn't work .我尝试重新启动,但没有用

But the one thing that finally (in an act of desparation where I'd try anything ... even the stupidest idea ever suggested...) that finally... DID WORK was:但有一件事是最后(在desparation的行为,我愿意尝试任何事情......即使最愚蠢的想法曾经建议...)终于......没有工作是:

I opened a new query tab.我打开了一个新的查询选项卡。 Copied my code from the script file I had open, Pasted it into the new query tab.从我打开的脚本文件中复制我的代码,将其粘贴到新的查询选项卡中。 And proceeded to be stunned in horror as intellisense began working again.当智能感知再次开始工作时,他惊呆了。

Not only did it begin working in my new query tab... but it began working in my original one as well.它不仅开始在我的新查询选项卡中工作……而且它也开始在我原来的选项卡中工作。

Sometimes I just want to bang my head againt the desk.有时我只想把头撞在桌子上。

Hope this tid bit helps someone.希望这一点可以帮助某人。 :) :)

PS Yes... I waited a while after each of the failed attempts to make sure intellisense wasn't taking it's good ole time trying to find itself. PS 是的......在每次失败的尝试之后,我都等了一段时间,以确保智能感知没有花时间试图找到自己。 The "New Query Tab" insanity worked instantly. “新查询选项卡”疯狂立即生效。

I fixed this in 2 simple steps:我通过两个简单的步骤解决了这个问题:

  1. Go to Tools > Options > Text Editor > Transact-SQL > IntelliSense , tick everything and setup the settings this way:转到Tools > Options > Text Editor > Transact-SQL > IntelliSense ,勾选所有内容并以这种方式设置设置:

在此处输入图片说明

  1. Go to Query > SQLCMD Mode , and disable that:转到Query > SQLCMD Mode ,并禁用它:

在此处输入图片说明

Issue:问题:

My SSMS Intellisense was not working.我的 SSMS Intellisense 无法正常工作。 Intellisense was Enabled from the Tools.从工具中启用了智能感知。 Refreshed the Intellisense Local cache and still no luck.刷新了 Intellisense 本地缓存,但仍然没有运气。

Solution:解决方案:

For me, the solution was to increase SQL Server Minimum memory per query y (in KB).对我来说,解决方案是增加每个查询y 的 SQL Server 最小内存(以 KB 为单位)。 It was set to 1024 KB(1M).它被设置为 1024 KB(1M)。 I increased it to 100 MB then it solved my problem.我将其增加到 100 MB,然后它解决了我的问题。

Disclaimer Notice:免责声明:

Please do not make this kind of changes without consulting your DBA and not knowing the resources available on that server.不要在未咨询您的DBA且不了解该服务器上可用资源的情况下进行此类更改。 It basically, will allocate that amount of space for every new query window you will open.它基本上将为您将打开的每个新查询窗口分配该空间量。 So, if you set too many users then you have low memory server and you set to something higher then your server might crash .因此,如果您设置了太多用户,那么您的服务器内存不足,而您设置的更高,那么您的服务器可能会崩溃

Minimum memory per query settings:每个查询设置的最小内存:

每个查询设置的最小内存:

I found solution at the end.我在最后找到了解决方案。 I installed SQL2008 R2 SP3.我安装了 SQL2008 R2 SP3。

It could also depends on your destination server.它也可能取决于您的目标服务器。

For instance for server 2005, intellisense will not work.例如,对于 server 2005,intellisense 将不起作用。 Here is a command to check this :这是一个检查这个的命令:

SELECT SERVERPROPERTY('ProductVersion');

If version begin with 8 or 9 it will not work .如果版本以8 或 9开头,它将不起作用

More information for : sql server intellisense trouble here更多信息: sql server intellisense 麻烦在这里

A workaround could be to use a sql server plugin as Autocomplete version express解决方法可能是使用 sql server 插件作为Autocomplete 版本 express

安装visual studio或升级之后,这个问题可能会发生,请点击以下链接: sqI ntelliSense中的IntelliSense问题是什么,为了解决这个问题,您可以这样做:通过更新到最新版本来更新sql server ,您可以获得您的解决方案。

  • if Auto list members and Parameter information boxes are ENABLE, make them disable and then press ok button.如果自动列表成员和参数信息框启用,则禁用它们,然后按确定按钮。 After the operation, make the boxes enable again and press ok button.操作后,再次使框启用,然后按确定按钮。
  • if Auto list members and Parameter information boxes are DISABLE, make them enable and then press ok button.如果自动列表成员和参数信息框是禁用的,使它们启用,然后按确定按钮。

If you have are seeing your text in red color, and have a bunch of statements, it could be because of a missing quote.如果您看到红色文本,并且有一堆语句,那可能是因为缺少引用。 Or a bad syntax check.或者错误的语法检查。 Try typing a quote at the end.尝试在最后输入引号。 Then Intellisense should kick in again in your next statement.那么 Intellisense 应该会在您的下一个声明中再次发挥作用。

This is what works for me almost every time when intellisense goes off.几乎每次智能感知关闭时,这对我都有效。 I go to the top of the query that I'm working on, and type:我转到我正在处理的查询的顶部,然后输入:

Use DatabaseName; 
go

in SQL Server Management Studio, highlight it, and hit F5 (replace name of database with whichever one you are working on right now).在 SQL Server Management Studio 中,突出显示它,然后按 F5(将数据库名称替换为您现在正在处理的数据库名称)。 When that has actioned, press Ctrl-shift-R, and then wait for around 30 seconds (maximum should be 2 mins).操作完成后,按 Ctrl-shift-R,然后等待大约 30 秒(最长应为 2 分钟)。 Intellisense should restart and make intelligent suggestions once again (assuming you are in the same query window as your F5 kick above). Intellisense 应该重新启动并再次提出智能建议(假设您与上面的 F5 键在同一个查询窗口中)。

You're welcome, mine is a pint of cider.不客气,我的是一品脱苹果酒。

Disabling / re-enabling IntelliSense worked for me:禁用/重新启用 IntelliSense对我有用:

Tools > Options > Text Editor > Transact-SQL > IntelliSense > Enable IntelliSense工具 > 选项 > 文本编辑器 > Transact-SQL > IntelliSense > 启用 IntelliSense

Something else that I'd like to add, when all of the above responses don't fix the issue.当上述所有回复均无法解决问题时,我还想补充一些其他内容。 I've noticed in SSMS that if there is a syntax error that intellisense sometimes doesn't work.我在 SSMS 中注意到,如果存在语法错误,智能感知有时会不起作用。

A quick /* */ around the block of code will usually take care of it.代码块周围的快速 /* */ 通常会处理它。

I hope this helps someone.我希望这可以帮助别人。

I just had a problem with one particular database.我只是遇到了一个特定数据库的问题。 Other databases on the same instance were fine.同一实例上的其他数据库都很好。 I tried refreshing local cache (Ctrl+Shift+R) and disabling and enabling IntelliSense via Tools --> Options, but enabling and then disabling SQLCMD Mode appeared to do the trick for me.我尝试刷新本地缓存 (Ctrl+Shift+R) 并通过工具 --> 选项禁用和启用 IntelliSense,但启用然后禁用 SQLCMD 模式似乎对我有用。 Perhaps it was a combination of these things.也许这是这些事情的结合。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server 2008 Management Studio Intellisense无法正常工作 - SQL Server 2008 Management Studio Intellisense not working SQL Server 2012 Management Studio Intellisense无法通过VPN工作 - SQL Server 2012 Management Studio Intellisense not working over VPN SQL Server Management Studio中JOIN的Intellisense - Intellisense for JOINs in SQL Server Management Studio SQL Server Management Studio 2008 R2开发人员版intellisense无法正常工作 - SQL Server Management Studio 2008 R2 Developer Edition intellisense not working SQL Server Management Studio 2012 IntelliSense(已刷新的缓存) - SQL Server Management Studio 2012 IntelliSense (already refreshed cache) 如何自动刷新SQL Server Management Studio智能缓存? - How to automatically refresh the SQL Server Management Studio intellisense cache? 查询在SQL Server Management Studio中不起作用 - Query is not working in SQL Server Management Studio 为什么Intellisense在SQL Server Management Studio 2008 R2中不起作用? - Why Intellisense doesn't work in SQL Server Management Studio 2008 R2? 是否有任何技巧允许在早期版本的SQL Server中使用Management Studio(版本2008)IntelliSense功能? - Is there any trick that allows to use Management Studio's (ver. 2008) IntelliSense feature with earlier versions of SQL Server? 为什么我的表没有显示在 SQL Server Management Studio 的智能感知中? - Why are my tables not showing up in SQL Server Management Studio's intellisense?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM