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
19 hours 39 min ago
3 days 8 hours ago
6 days 10 hours ago
6 days 10 hours ago
1 week 14 hours ago
1 week 1 day ago
2 weeks 1 day ago
2 weeks 1 day ago
2 weeks 5 days ago
2 weeks 5 days ago