Click here to Skip to main content
16,004,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

Dear friends

 

I do not know how can I copy a stored procedure, using VB.net

I know how can I create it. but the question is how can I copy it from a DB to another.

Thank you

Posted
Updated 20-Nov-09 20:30pm
v2

1 solution

This walkthrough should be particularly useful to you:

http://www.sqlteam.com/article/scripting-database-objects-using-smo-updated

And this is some related MSDN documentation:

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.aspx

And I'm not sure, but these classes may be of use to you, so you may want to look into them:

Microsoft.SqlServer.Management.Smo.Scripter
Microsoft.SqlServer.Management.Smo.StoredProcedure

And before you start anything, make sure to add a reference to this assembly:

Microsoft.SqlServer.Smo

The basic idea is that you'll script it out from one database then apply the script to another database. This is, of course, assuming that you want to do all this programmatically.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900