Locate Startup Stored Procedures

Locate Startup Stored Procedures

Quick check for stored procedures run at startup. This will help you determine what stored procedures you may have set to run at startup. I use this quite often (in modified form) to locate SQL Servers in the domain, leveraging SQL Server CMS (Centralized Management Server), running the SQL Blackbox trace.

Locate Startup SProcs:

Exec master..sp_MSforeachdb
'Select ''?'' [Database Name],
     name as [Startup Proc Name]
From [?]..sysobjects
Where type = ''p''
     and OBJECTPROPERTY(id, ''ExecIsStartup'') = 1;'

Tested to run on SQL 2000/2005/2008

Leave a Reply

Your email address will not be published. Required fields are marked *