Sample code for exporting scripts to drop and recreate all user defined Stored Procedures and Functions in a database.
The code uses SQL 2005/2008 Server Management Objects to accomplish this task. It loops through all functions and SPs and writes drop command for each of them then loops through and appends the create scripts for them to the same file. All commands are appended to the "c:\SomePath\SPExport.sql" file.
Update (2010/07/29): Added IronPython example.
C# Code
using Microsoft.VisualBasic; using System; using System.Collections;
Recent comments
2 days 11 hours ago
5 days 13 hours ago
5 days 13 hours ago
6 days 17 hours ago
1 week 16 hours ago
2 weeks 19 hours ago
2 weeks 19 hours ago
2 weeks 4 days ago
2 weeks 5 days ago
2 weeks 5 days ago