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 ' '''', '''',