简体   繁体   English

如何在SQL Server中查找使用“我的数据库”的存储过程

[英]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.

相关问题 SQL Server:如何从数据库中的所有存储过程中找到特定值? - SQL Server : how can I find the specific value from all stored procedures in my database? SQL Server中的所有存储过程都存储在哪个数据库中? - All the stored procedures in SQL Server are stored in which database? 如果我的所有sql server数据库访问都是通过存储过程完成的 - If all my sql server database access is done thru stored procedures 使用Query查找在SQL Server中使用游标的所有存储过程 - Find all the stored Procedures that use a cursor in SQL Server using Query 如何在SQL Server 2012中查找作用于表的存储过程? - How to find the stored procedures acting on a table in SQL Server 2012? 如何在SQL Server数据库中一次删除所有存储过程? - How to drop all stored procedures at once in SQL Server database? 如何在SQL Server中查找存储过程执行时间? - How to find Stored Procedures execution time in SQL Server? 如何统计SQL服务器中一个数据库的所有存储过程? - How to count all stored procedures in the SQL Server for a database? SQL Server-以任何方式查找哪些存储过程返回集而哪些不返回集? - Sql Server - Any way to find which stored procedures return sets and which not? 如何查找哪个 SQL Server 作业正在使用存储过程? - How to find which SQL Server job is using the stored procedure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM