Articles in categories

Now on Amazon

Stieven's Corner

Copy Stored Procedures between databases

Ever need to copy Stored Procedures, Views or other objects from one database to another?
Here's how to do it.

  1. Rightclick the database and select Tasks --> Generate scripts
  2. A wizard will open.
  3. Select the objects, in my case Stored Procedures, you want to copy.
  4. Specify how scripts should be saved or published.
  5. Run the script.

Keep in mind that when the copy script is created a USE keyword is used. You need to remove it or change it to the correct database.