dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Get-DbaDbStoredProcedure

Gets database Stored Procedures.

Screenshots

dbatools-Get-DbaDbStoredProcedure

Examples

Gets all database Stored Procedures.

Get-DbaDbStoredProcedure -SqlInstance sql2016

Gets the Stored Procedures for the db1 database.

Get-DbaDbStoredProcedure -SqlInstance Server1 -Database db1

Gets the Stored Procedures for all databases except db1.

Get-DbaDbStoredProcedure -SqlInstance Server1 -ExcludeDatabase db1

Gets the Stored Procedures for all databases that are not system objects.

Get-DbaDbStoredProcedure -SqlInstance Server1 -ExcludeSystemSp

Gets the Stored Procedures for the databases on Sql1 and Sql2/sqlexpress.

‘Sql1′,’Sql2/sqlexpress’ | Get-DbaDbStoredProcedure

Author

This command was created by Klaas Vandenberghe. You can find Klaas on Twitter.

Get-Help

From PowerShell, execute Get-Help Get-DbaDbStoredProcedure -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaDbStoredProcedure.ps1 on GitHub
 

Related commands