Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#/SQL Get all Stored Procedures and their Code

How can I obtain all stored procedures and their code from SQL Server?

I need to show data that is similar to what SQL Server Management Studio shows, incl. allowing to browse through SP's with code, tables and indexes.

Any hints on how to get this information out of SQL Server? P.S., I'm using C#.

like image 952
Alex Avatar asked Oct 14 '22 13:10

Alex


1 Answers

SQL Server Management Objects (SMO) would be a good place to start. This article has code examples including listing Stored Procedures:

Getting started with SQL Server Management Objects (SMO)

like image 113
Mitch Wheat Avatar answered Oct 19 '22 01:10

Mitch Wheat