SQL Server 多架构对象问题
我的数据库下有多个模式和对象。我想将这些对象合并到一个模式中。
我尝试过
ALTER SCHEMA dbo TRANSFER <custom_schema>.<table_name>
,我得到了
对象已存在消息
但是,我在管理工作室中看不到它并
SELECT * from dbo.<table_name>
返回
对象不存在。
看起来某些系统表条目不正常。我查看了 sysobjects,它只有一个 .欢迎就如何解决/解决此问题提出任何建议。
注意:我可以创建一个同义词,
CREATE SYNONYM dbo.<table_name> FOR <custom_schema>.<table_name>
效果很好
I have database that has multiple schemas and objects under them. I want to consolidate the objects into one schema.
I tried
ALTER SCHEMA dbo TRANSFER <custom_schema>.<table_name>
I get an
object already exists message
However, I can't see it in the Management studio and
SELECT * from dbo.<table_name>
returns
object does not exist.
Looks like some system table entry is out of whack. I looked at sysobjects and it has only one entry for . Any suggestions on how to trouble shoot/ fix this issue is welcome.
Note: I can create a synonym
CREATE SYNONYM dbo.<table_name> FOR <custom_schema>.<table_name>
works fine
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据此 MSDN 页面,您的问题可能是由重复的主键名称引起的强>。即您的 table_name 的主键名称与 dbo 中其他表中已定义的主键名称冲突。
According to this MSDN page your issue may be caused by a duplicate primary key name. i.e. your table_name's primary key name conflicts with a primary key name already defined within some other table in dbo.