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
- Dozens more answers to tough SQL Server questions from Michael Hotek are available here.
- The Best Microsoft SQL Server Web Links: tips, tutorials, scripts, and more.
- Have a SQL Server tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical SQL Server questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, SQL Server, DB2, object-oriented and data warehousing gurus are waiting to answer your toughest questions.