脚本化创建后,SQL Management Studio 无法识别表存在 [英] SQL Management Studio won't recognize a table exists after scripted create

查看:27
本文介绍了脚本化创建后,SQL Management Studio 无法识别表存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,如果我在数据库上点击刷新后在 SQL Management Studio 的查询编辑器中创建一个新表,我可以看到并使用该表.但是,如果我想从查询编辑器中运行另一个查询引用该表,它不会重新识别该表是否存在.我试过在数据库级别和表级别点击刷新,但没有区别.但是,如果我退出管理工作室然后重新打开它会显示正常.

So if I create a new table in the query editor in SQL Management Studio after hitting refresh on the DB I can see and work with that table. However if I want to run another query referencign that table from withen the query editor it doesn't reconize that table exists. I've tried hitting refresh at the DB level, and the table level but it makes no difference. However if I quit the management studio then reopen it shows up fine.

USE [DataBaseName]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[States](
    [StateAbbreviation] [nchar](2) NOT NULL,
    [StateFullName] [nchar](30) NULL,
GO

所以我运行那个然后运行这个.

So I run that and then run this.

INSERT INTO States
SELECT *
FROM ExistingStatesTable

这不能说状态不存在.状态也没有出现在智能感知中.我该怎么办

This fails saying that States doesn't exist. Also States doesn't show up in the intelisense. What should I do to

推荐答案

按 Ctrl-Shift-R 刷新智能感知.

Press Ctrl-Shift-R to refresh the intellisense.

这篇关于脚本化创建后,SQL Management Studio 无法识别表存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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