SQL Server 企业管理器 - 批量删除表和更改表的所有权
我几乎没有使用 SQL Server 企业管理器的经验,所以我不确定这是否可能(或者希望简单得可笑!)
在导入数据库期间,发生了一些情况,每个表都重复了自身,但有两个重要的区别。
第一个是两个表的所有者不同,第二个是只有结构复制到其中一个副本上。
Sod 定律表明,数据当然存储在错误的人拥有的表上,所以我的问题是我是否可以快速删除一个用户拥有的所有表,并且可以快速更改所有其他表的所有权以使它们保持一致。
有足够多的桌子,自动化将成为我长期以来的首选!
I have pretty much no experience with SQL Server's Enterprise Manager so I am not sure if this is even possible (or hopefully laughably simple!)
During an import into a database something has happened where each table has duplicated itself with two important differences.
The first is that the Owner on both tables is different, the second is that only the structure has copied across on one of the copies.
Sod's law indicated that of course the data was stored on the tables owned by the wrong person, so my question is can I quickly delete all tables owned by one user and can I quickly change the ownership of all other tables to bring them in line.
There are enough tables that automation is going to be my preferred option by a LONG way!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要更改所有权,请参阅: SQL表所有权更改,快速简单
上面链接中给出的代码是:
For changing ownership, see: SQL Table Ownership Changes, Quick and Easy
The code given in the above link is: