Exporting SQL Server data to script

There are some situation where data in one SQL server database need to be exported as a script in order to publish it to another server.

There are plenty of scripts and tools around the web, for instance Red Gate's SQL Data Compare tool is pretty nice. But if you're on a tight budget, this one might be out of reach. So what to do?

If you're running SQL Server 2008 you already have this feature. You can use the generate script wizard in order to get the data as INSERT-statements.

If you're running SQL Server 2000/2005 you need to download Microsoft SQL Server Database Publishing Wizard. It's a stand alone tool that lets you script the database structure and/or the data contained in your database.

Note on the database publishing wizard for 2000/2005: You might get a 'file already in use' when you export. If so, just delete the file, back one step and have another go. It usually works.

Related posts:

Comments

comments powered by Disqus