[英]How to find stored procedures which are using 'My Database' in SQL Server
Is there any way I can find how many stored procedures are created referencing My Database
? 有什么办法可以找到创建了引用“ My Database
存储过程?
IF I change database name from My Database
to No Database
, how to modify all the stored procedures referencing to my OLD database name to new database name? 如果我将数据库名称从“ My Database
更改为“ No Database
,如何将所有引用我的OLD数据库名称的存储过程修改为新数据库名称?
If your stored procedures actually have the text 'My Database' in them, you can use this, replacing 'ADB' with 'DatabaseName': 如果您的存储过程中确实包含文本“我的数据库”,则可以使用它,将“ ADB”替换为“ DatabaseName”:
SELECT DISTINCT o.name AS Object_Name,o.type_desc
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON m.object_id=o.object_id
WHERE m.definition Like '%ABD%'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.