SQL 2005无法删除用户
我已将数据库从备份恢复到新服务器上,但无法从数据库中删除旧架构。 我已经为此数据库创建了一个新用户。 新用户的命名不同(以使其他开发人员更清楚),因此我没有使用此模式。 我最终成功删除了用户,但模式不会消失。
我收到的错误是“无法删除架构”,因为它被对象“引用”
运行此脚本:
select * from sys.objects where schema_id = 5
...显示该架构“拥有”的所有对象。
我的问题是我找不到更改所有权的方法这些物体一定有办法吗? 谢谢大家
I have restored a database from a backup onto a new server, and I cannot delete the old schema from the database. I have created a NEW user for this database. The NEW user is named differently (to make things clearer for other developers), so I have no use for this schema. I DID manage to delete the USER finally, but the schema won't go away.
The error I receive is "Cannot drop schema '' because it is being referenced by object ''
Running this script:
select * from sys.objects where schema_id = 5
...shows all the objects this schema 'owns'.
My problem is I cannot find a way to change the ownership of these objects. There must be a way?
Thanks all
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将对象事物从模式源移动到模式目标的语法是:
这里是 SQL 生成一个脚本以将所有对象传输到 dbo 架构:
仅传输一个特定架构:
The syntax to move object Thing from schema Source to schema Destination is:
Here's SQL to generate a script to transfer all objects to the dbo schema:
To just transfer one particular schema: