We have a production SQL Server 2005 database server with the production version of our application’s database on it. I would like to be able to copy down the data contents of the production database to a development server for testing.
Several sites (and Microsoft’s forums) suggest using the Backup/Restore options to copy databases from one server from another, but this solution is unworkable for several reasons (I don’t have backup authority on our production database, I don’t want to overwrite permissions on the development server, I don’t want to overwrite structure changes on the development server, etc…)
I’ve tried using the SQL Import/Export Wizard in SQL Server 2005, but it always reports primary key violations. How can I copy the contents of a database from the production server to development without using the ‘Backup/Restore’ method?
Well without the proper rights it really becomes more tedious and less than ideal.
One way that I would recommend though is to drop all of your constraints and indexes and then add them again once the data has been imported/exported.
Not an elegant solution but it’ll process really fast.
EDIT: Another option is to create an SSIS package where you specifically dump the tables in an order that won’t violate the constraints.