The “SQL Server Management Objects” series
GENERATING SQL SCRIPTS FOR STORED PROCEDURES, FUNCTIONS, VIEWS & TRIGGERS
: Feri Djuandi
Platform : MS SQL Server 2008, Visual C# 2010
Suggested to read the first part of this document series titled “Connecting the SQL Server” as the introduction and basic.
In this article we are going to learn how to generate the SQL scripts for stored procedures, functions, views and triggers using SQL Server Management Objects (SMO). Following are the tools used for the program demo:
MS SQL Server 2008 Evaluation Edition
MS Visual C# 2010 Express
Please open the sample program SmoPractice06.zip attached to this document. Go ahead extracting the ZIP file into your local computer and open the project file.
Try to run the program, and you will find a screen like this.