devxlogo

Execute a Stored Procedure in All Databases of SQL Server

Execute a Stored Procedure in All Databases of SQL Server

To execute a stored procedure in all databases of SQL Server, you should create the candidate stored procedure in the master database and pass it as a parameter to the attached stored procedure. This candidate procedure’s name must start with ‘sp_’. Then execute this statement:

 sp_execute_proc_inalldb  ' '''', '''',

devx-admin

Share the Post: