如何以编程方式确定存储过程是否从另一个数据库中进行选择?
在 MS SQL Server 2000 安装中,我有许多存储过程,它们从存储数据的数据库以外的数据库中提取数据。所有选择都发生在同一数据库服务器上。例如:
select * from [OtherDatabase]..table
如何在不逐一查看的情况下找到哪些程序执行此类操作?
On an MS SQL Server 2000 installation I have numerous stored procedures that pull data from databases other than the one it's stored in. All selects occur on the same database server. For example:
select * from [OtherDatabase]..table
How can I find which procedures do that sort of thing without eyeballing each one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是一个存储过程,它将搜索任何存储过程中包含的文本。您可以使用它来搜索可能被调用的各种数据库。
The following is a stored proc that will search for text contained in any stored proc. You could use this to search for the various databases that might get called.
这段代码可以吗...您需要临时连接到其他服务器上的数据库吗?您需要成为“系统管理员”组的成员才能正常工作...补充我的想法...这可能是错误的,请随时指出这一点...
Would this code do...You would need to temporarily connect to the database on the other server? You would need to be a member of the 'sysadmin' group for this to work...top off my head....it may be wrong, feel free to point this out...