sql server无效的对象名称 - 但表列在SSMS表列表中

在尝试为新数据库创建查询时,SQL Server的IntelliSense无法识别已创建的表。尽管表出现在SSMS的表列表中,但在查询窗口中输入表名时,只有部分表被识别。建议刷新表列表、IntelliSense缓存或使用快捷键Ctrl + Shift + R来解决这个问题。
摘要由CSDN通过智能技术生成

本文翻译自:sql server invalid object name - but tables are listed in SSMS tables list

I am attempting to create a Stored Procedure for a newly created database. 我正在尝试为新创建的数据库创建Stored Procedure However the SSMS intellisense does not recognize more than half of the tables which have been created. 然而, SSMS智能感知不能识别已创建的一半以上的表。

For example whilst in the left hand column under tables I have a table dbo.Room , when I type " dbo. " in the new query window, that table is not listed, in fact only 17 out of 37 tables are listed. 例如,虽然在表格左下方的列中我有一个表dbo.Room ,当我在新查询窗口中键入“ dbo. ”时,该表未列出,实际上只列出了37个表中的17个。

I can see no difference between the tables listed by intellisense and those not. 我可以看到intellisense列出的表与没有表的表之间没有区别。 If I manually type dbo.Room, it is underlined, with an error of 如果我手动输入dbo.Room,则会加下划线,错误为

Invalid Object Name 'dbo.Room'.. 无效的对象名称'dbo.Room'..

Have I missed something in setting up the tables? 我在设置桌子时错过了什么吗?

UPDATE: I have tried refresh of the tables list (several times) 更新:我已经尝试刷新表列表(几次)


#1楼

参考:https://stackoom.com/question/5iSJ/sql-server无效的对象名称-但表列在SSMS表列表中


#2楼

你尝试过:右键单击数据库,然后单击“刷新”


#3楼

Are you certain that the table in question exists? 你确定有问题的表存在吗?

Have you refreshed the table view in the Object Explorer? 您是否在对象资源管理器中刷新了表视图? This can be done by right clicking the "tables" folder and pressing the F5 key. 这可以通过右键单击“tables”文件夹并按F5键来完成。

You may also need to reresh the Intellisense cache. 您可能还需要重新刷新Intellisense缓存。

This can be done by following the menu route: Edit -> IntelliSense -> Refresh Local Cache 这可以通过以下菜单路径完成:编辑 - >智能感知 - >刷新本地缓存


#4楼

Try: 尝试:

Edit -> IntelliSense -> Refresh Local Cache 编辑 - > IntelliSense - > 刷新本地缓存

This should refresh the data cached by Intellisense to provide typeahead support and pre-execution error detection. 这应该刷新Intellisense缓存的数据,以提供预先支持和执行前错误检测。

NOTE: Your cursor must be in the query editor for the IntelliSense menu to be visible. 注意:您的光标必须位于查询编辑器中才能看到IntelliSense菜单。


#5楼

Ctrl + Shift + R也会在management studio 2008中刷新intellisense。


#6楼

once you create a new SQL Server object, your newly created object does not get updated in the IntelliSence Local Cache and due to this, it shows red line underneath that object. 一旦创建了新的SQL Server对象,新创建的对象就不会在IntelliSence Local Cache中更新,因此,它会在该对象下面显示红线。 So you just need to refresh SSMS IntelliSence Local Cache and once you refresh it, IntelliSence will automatically add newly created object in the cache and the red line will disappear. 因此,您只需刷新SSMS IntelliSence Local Cache,一旦刷新它, IntelliSence将自动在缓存中添加新创建的对象,红线将消失。 try this 试试这个

Edit -> IntelliSense -> Refresh Local Cache or Ctrl + Shift + R Edit -> IntelliSense -> Refresh Local CacheCtrl + Shift + R.

在此输入图像描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值