简体   繁体   English

SQL Server 2008 R2 智能感知不起作用

[英]SQL Server 2008 R2 intellisense not working

Just started a new job and everything was already installed on my machine.刚刚开始一份新工作,所有东西都已经安装在我的机器上。 It's not exactly a friendly bunch.这并不完全是一群友好的人。 (early days) (早些年)

I have SQL Server 2008 R2 and I see I have Visual Studio 2010 SP1.我有 SQL Server 2008 R2,我看到我有 Visual Studio 2010 SP1。

I don't have any intellisense in SQL Server Management Studio.我在 SQL Server Management Studio 中没有任何智能感知。

Googled and found hundreds of hits!!!谷歌搜索并发现数百个点击!

Ultimately I have found this link:最终我找到了这个链接:

http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2507770&kbln=en-us#step1 http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2507770&kbln=en-us#step1

The problem is I have so many hotfixes to choose from and I don't know which one Do you know?问题是我有很多修补程序可供选择,但我不知道您知道哪一个?

在此处输入图片说明

thanks a lot多谢

First of all - intellisense in SQL Server Management Studio 2008 and newer only works against databases that are also 2008 or newer - it will not work against a 2005 database.首先 - SQL Server Management Studio 2008 和更新版本中的智能感知仅适用于 2008 或更新版本的数据库 - 它不适用于 2005 数据库。

Next - have you made sure intellisense is enabled in SSMS ?接下来 - 您是否确保在 SSMS 中启用了智能感知?

在此处输入图片说明

Then - if it is enabled - sometimes it helps to refresh the local cache:然后 - 如果它已启用 - 有时它有助于刷新本地缓存:

在此处输入图片说明

Late answer but can be useful to other readers:迟到的答案,但对其他读者可能有用:

If you installed Visual Studio 2010 SP1 and you're using SQL Server 2008 R2, it is likely that your IntelliSense may stop working.如果您安装了 Visual Studio 2010 SP1 并且您使用的是 SQL Server 2008 R2,则您的 IntelliSense 可能会停止工作。 There is a fix for this and it was released in SQL Server 2008 R2 SP1.对此有一个修复程序,它已在 SQL Server 2008 R2 SP1 中发布。

For more information please read this KB article: https://support.microsoft.com/en-us/kb/2531482有关更多信息,请阅读这篇知识库文章: https : //support.microsoft.com/en-us/kb/2531482

According this article http://www.sqlshack.com/using-and-troubleshooting-sql-server-intellisense-sql-server-2012-higher/ , here are some of the common reasons why IntelliSense isn't working:根据这篇文章http://www.sqlshack.com/using-and-troubleshooting-sql-server-intellisense-sql-server-2012-higher/ ,以下是 IntelliSense 不工作的一些常见原因:

  1. Firstly check if IntelliSense is enabled as explained earlier in the article.首先检查 IntelliSense 是否已启用,如本文前面所述。 Also ensure that the Statement Completions settings are correct.还要确保 Statement Completions 设置正确。

  2. Ensure that there is no syntax error anywhere on the page before your cursor, resolving the code error should re-activate IntelliSense.确保光标前页面上的任何位置都没有语法错误,解决代码错误应重新激活 IntelliSense。

  3. IntelliSense does not work inside comments, uncomment the section to be able to get the suggestions. IntelliSense 在评论中不起作用,取消注释该部分以获得建议。

  4. IntelliSense does not work inside a quotes. IntelliSense 在引号内不起作用。 Be sure to place your cursor outside of any quotes.确保将光标放在任何引号之外。

  5. Ensure that you are connected to a SQL Server Instance or a database project.确保您已连接到 SQL Server 实例或数据库项目。

  6. IntelliSense is only supported on SQL Server 2008 and higher. IntelliSense 仅在 SQL Server 2008 及更高版本上受支持。

  7. IntelliSense does not work for encrypted objects. IntelliSense 不适用于加密对象。

  8. Not all syntax is supported.并非所有语法都受支持。

  9. Are you running in SQLCMD mode?您是否在 SQLCMD 模式下运行? Unfortunately IntelliSense is not supported in command mode.不幸的是,命令模式不支持 IntelliSense。 Return to regular mode to get IntelliSense.返回常规模式以获取 IntelliSense。

  10. IntelliSense is currently not supported for SQL Azure SQL Azure 目前不支持 IntelliSense

I just had the same issue and realized that is nothing about VS 2010 or whatever app.我刚刚遇到了同样的问题,并意识到这与 VS 2010 或任何应用程序无关。

All you have to do to enable IntelliSense on SQL 2008 is:在 SQL 2008 上启用 IntelliSense 所需要做的就是:

1) Run Windows Update and install 2 updates about SQL Server 2008 (SP1 and SP3); 1)运行Windows Update并安装2个关于SQL Server 2008(SP1和SP3)的更新; Link - http://www.catalog.update.microsoft.com/Search.aspx?q=SQL%20Server链接 - http://www.catalog.update.microsoft.com/Search.aspx?q=SQL%20Server

2) Restart and make sure Intellisense is enable on SQL Server: Tools>Options>Text Editor>Transact-SQL>IntelliSense 2) 重新启动并确保在 SQL Server 上启用 Intellisense:工具>选项>文本编辑器>Transact-SQL>IntelliSense

3) Refresh Local Cache by pressing Ctrl + Shift + R 3) 按 Ctrl + Shift + R 刷新本地缓存

4) Done. 4)完成。

Also if you have Query |此外,如果您有查询 | SQLCMD turned On it will stop IntelliSense from working, even though you have it set up in all the places mentioned above and you are on the latest patch. SQLCMD打开它会阻止 IntelliSense 工作,即使您在上面提到的所有地方都设置了它并且您使用的是最新的补丁。

To answer your question directly, one of the answers on this post, Why is SQL Server 2008 Management Studio Intellisense not working?要直接回答您的问题,请使用这篇文章中的答案之一, 为什么 SQL Server 2008 Management Studio Intellisense 不起作用? , suggests that the second from the bottom would be the one you want: , 表明倒数第二个将是您想要的:

SQLServer2008R2_RTM_CU7_2507770_10_50_1777_x64 SQLServer2008R2_RTM_CU7_2507770_10_50_1777_x64

However, that is just the hotfix that this was released in, there are more current cumulative updates.但是,这只是发布的修补程序,还有更多当前的累积更新。 See the list here: http://support.microsoft.com/kb/981356请参阅此处的列表: http : //support.microsoft.com/kb/981356

Though you're having SQL Server 2008 R2 IDE but if you're connected with SQL Server 2005, intellisense won't work.尽管您使用的是 SQL Server 2008 R2 IDE,但如果您连接的是 SQL Server 2005,智能感知将无法工作。

Please check out this link, it might help you to solve your problem.请查看链接,它可能会帮助您解决问题。

请重新安装 sql 或在 google 上搜索下载“SQLServer2008R2-KB2507770-x86.exe”并运行 100% Work For sql sever R2 2008

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM