Friday, February 02, 2007

Good way to transfer database.

I have been looking for a method which can easily transfer my database on the local machine to the hosting server. I don't have the enterprise manager, the express management studio seems not support this functionality. I have been trying to write some scripts using smo, but was not very successful. Finally, I found this SQL Server Hosting Toolkit, and it's very useful.

1> Connect to your local database, and script the database into an SQL file.

2> Connect to the remote database, and open and SQL query window, then copy all the scripts into the SQL query window. Run the scripts, it will generate all the objects and data into the remote database.

1 comment:

Unknown said...

if you want to see how to do it with SMO, here's an app I wrote a while ago that generates scripts for all objects in any 2000 or 2005 database using SMO. source is available.

http://www.elsasoft.org/tools.htm