Thor Logo dbatools

StartupProcedure

Copy-DbaStartupProcedure

Shawn Melton (@wsmelton), wsmelton.github.io

Copy-DbaStartupProcedure View Source Shawn Melton (@wsmelton), wsmelton.github.io Windows, Linux, macOS Synopsis Copies startup procedures from master database between SQL Server instances Description Migrates user-defined startup procedures stored in the master database from source to destination SQL Server instances. Startup procedures are stored procedures that automatically execute when SQL Server starts up, commonly used for server initialization tasks, custom monitoring setup, or configuration validation. This function identifies procedures flagged with the startup option using sp_procoption, copies their definitions to the destination master database, and configures them as startup procedures.

Read more

Disable-DbaStartupProcedure

Patrick Flynn (@sqllensman)

Disable-DbaStartupProcedure View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Removes stored procedures from SQL Server’s automatic startup execution list Description Prevents stored procedures from automatically executing when the SQL Server service starts by clearing their startup designation in the master database. This is essential when troubleshooting startup issues or removing procedures that were previously configured to run at service startup. Equivalent to running sp_procoption with @OptionValue = off, but provides object-based management with detailed status reporting.

Read more

Enable-DbaStartupProcedure

Patrick Flynn (@sqllensman)

Enable-DbaStartupProcedure View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Configures stored procedures in the master database to execute automatically when SQL Server service starts Description Marks stored procedures in the master database for automatic execution during SQL Server startup, eliminating the need to manually run initialization scripts after service restarts. This is essential for DBAs who need to ensure critical maintenance procedures, monitoring setup, or custom configurations are applied consistently every time the instance starts.

Read more

Get-DbaStartupProcedure

Patrick Flynn (@sqllensman)

Get-DbaStartupProcedure View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves stored procedures configured to run automatically when SQL Server starts up. Description This function returns stored procedures from the master database that are configured to execute automatically during SQL Server startup. Startup procedures are useful for initializing application settings, populating cache tables, or performing other tasks that need to run every time the SQL Server service starts. The function returns SMO StoredProcedure objects with details about each startup procedure, including creation dates, schemas, and implementation types.

Read more