How to import/export SQL tables, functions and stored procs with SQL Management Studio 2005

  • In Microsoft SQL Server Management Studio Express, expand the databases.
  • Right-Click on the database containing objects you want to copy to another database
  • Click on Tasks, then Generate Scripts… This will open up the Script Wizard, which is pretty much self-explanatory:
    • Select the database (which should be pre-selected for you),
    • Select Options (first time around you might just accept the default selections),
    • Choose the Object Types you want to script (Stored Procedures, User Defined Functions, etc),
    • Select the specific objects to be scripted,
    • and finally specify where to output the script (choose Script to new Query Window for convenience).
  • Once completed, return to the Query Window with the scripted objects.  Change the USE directive (the first line) to point to the destination database (e.g., USE [Northwind]), and execute the script.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s