Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server SQL Server Management Studio关于foreignkey古怪的描述_Sql Server_Sql Server 2008_Ssms - Fatal编程技术网

Sql server SQL Server Management Studio关于foreignkey古怪的描述

Sql server SQL Server Management Studio关于foreignkey古怪的描述,sql-server,sql-server-2008,ssms,Sql Server,Sql Server 2008,Ssms,在中,我们在此对话框中输入a的说明(从表Campus中修改外键): 正如你所看到的,描述似乎很有说服力 但是,如果我运行此查询: select object_name([major_id]), [ep].[name], [value] from sys.extended_properties ep INNER join sys.objects o on o.object_id = major_id where o.[type] = 'F' 结果是: FK_Campus_School M

在中,我们在此对话框中输入a的说明(从表
Campus
中修改外键):

正如你所看到的,描述似乎很有说服力

但是,如果我运行此查询:

select object_name([major_id]), [ep].[name], [value]
from sys.extended_properties ep
INNER join sys.objects o on o.object_id = major_id
where o.[type] = 'F'
结果是:

FK_Campus_School    MS_Description  foobar
如果我在描述字段中输入文本(因为我认为该字段尚未设置),我将覆盖原始值

我知道我可以使用此存储过程从脚本添加/更新扩展属性:

EXEC sys.sp_addextendedproperty /* sp_updateextendedproperty */
@name = N'MS_Description', 
@value = N'is this saved again?', 
@level0type = N'SCHEMA', 
@level0name = N'Data', 
@level1type = N'TABLE', 
@level1name = N'Campus',
@level2type = N'CONSTRAINT', 
@level2name = N'FK_Campus_School';
请注意,如果属性已定义,则调用sp_addextendedproperty会引发异常。对话框似乎总是进行更新

我试过什么

如果打开引用表上的外键对话框,则会显示文本。该对话框还显示FK_Campus_School密钥,选择该密钥后,将显示描述。返回校园表,将显示外键说明。然而,在执行了一个查询之后,我又回到了同一条船上

点击刷新按钮和/或上下文菜单选项无法解决此问题

我还可以做些什么让SQL Server Management Studio在外键修改对话框中可靠地显示描述?

版本信息:

| Microsoft SQL Server Management Studio  | 10.50.1617.0
| Microsoft Data Access Components (MDAC) | 6.1.7601.17514
| Microsoft MSXML                         | 3.0 4.0 5.0 6.0 
| Microsoft Internet ExploreR             | 8.0.7601.17514
| Microsoft .NET Framework                | 2.0.50727.5472
| Operating SysteM                        | 6.1.7601

目标:SQL Server 2008 R2

您必须刷新IntelliSense:

  • 在SQLServerManagementStudio中,菜单“编辑->智能感知->刷新本地缓存”

  • Ctrl+Shift+R

它在SQL Server 2012中工作。我还在SQL Server 2008 R2中测试了我的解决方案,但它不起作用。

您是否尝试过查看它在不同版本的SSM中是否正确显示?也许SSMS-2012?从那时起,您是否更新了SSMS 2008 R2?