arpit.net : Technology and other shots...

Monday, January 21, 2008

Duplicating a database using SQL Server Management Studio Express

I recently started playing around with Asp.Net and SQL Server 2005. Though we have Visual Studio 2005 Professional, I still use SQL Server Management studio's express edition for administration of the databases. It is a great and easy to use tool, but it lacks few basic features.

One of them is copying a database - Both to a remote machine or locally.

However, with another free download from Microsoft, you can easily do this. You will need to download the tool called: Microsoft SQL Server Database Publishing Wizard


Here are the steps to accomplish this:
  1. Download, install and run the SQL Server Database Publishing Wizard
  2. Provide the server and login information for the server where the database resides and click next. Once the connection is established, it will list all the available databases.
  3. Select the required database and click next
  4. The next screen will show you the option to script the database to a file or publish it to a remote server. In this case, you can script to a file and click finish.
  5. Now, launch SQL Server Management Studio express and connect to the server (where you want the duplicate version of the database to be created)
  6. Create a new database, which will be the duplicate one.
  7. Go to Security and set this as the default database
  8. Run the script we just saved using the Database Publishing Wizard
  9. Thats it! You should now have a duplicate database with all the database objects and the data itself.
For more information on Database Publishing Wizard and its uses, consider reading this article.

If you know a better way of doing this, feel free to comment upon!

2 Comments:

  • I have created the script and have set security.

    However, I do not know how to run the script. Can you give more details

    By Blogger Kevin, at 3:56 PM  

  • @Kevin: Run the script using the SQL Studio Management Express with the default DB as the one you want to update.

    By Blogger AJ, at 4:24 PM  

Post a Comment

Links to this post:

Create a Link

<< Home