Copying stored procedures from one SQL Server to another

I have and ASP.NET and VB.NET application that needs to copy selected stored procedures from one SQL Server to another SQL Server. The scenerio is that the user will select a source server from a drop down list, then the source database from another drop down listbox, which then populates a listbox with the stored procedures in the database. They can select multiple stored procedures from the listbox.

Once selected, they select a target SQL Server from a drop down list and then a target database from another drop down list. I have a command button that they need to use to do the actual move, but I am not sure how to get the selected source stored procedures copied to the target database. Any ideas would be greatly appreciated.

All of the documentation for SQL-DMO is in Books Online. The installation CD also has several DMO examples. If you want to go directly after the information instead of through DMO (not recommended for your situation), you can capture the commands being executed within this feature of Enterprise Manager by utilizing Profiler to trace the commands issued by Enterprise Manager when you perform an operation.


For More Information

Dig Deeper on Microsoft SQL Server Installation