Monday, March 26, 2012

Restoring test data

I have a 2-part question.
1. I'm looking for a good strategy to save my data that I use for testing.
I made a set of good test data, and backed it up. I write my programs,
enter test trx, and then I want to start fresh again, so I restore from my
test data backup. This works fine.
For kicks, I tried to export the data to a new database. That worked fine.
But if I try to export data from the new database into my existing database,
I get lots duplicate key errors. I even tried setting the option to Delete
data, but that doesn't work because of foreign key constraints setup on some
of the tables.
Just curious what the recommened strategy for restoring test data is to
start anew!
2. When I make a change to the database, my collegues may have their own
test data and don't want to restore the test data that I have, but need the
database changes. What is the best way to do this? Should I just generate
the scripts for the tables I have changed?
Thanks for you help.If you want to start a fresh, then why not just drop the tables in the right
order, recreate the tables, and repopulate them with data?
This way, you will get to have scripts for both strucutres of the tables,
and data. So, if you only want structure, just run those CREATE TABLE
scripts.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Nancy De Cecco" <smiling.nancy@.verizon.net> wrote in message
news:#T0Iy5g2DHA.2620@.TK2MSFTNGP09.phx.gbl...
I have a 2-part question.
1. I'm looking for a good strategy to save my data that I use for testing.
I made a set of good test data, and backed it up. I write my programs,
enter test trx, and then I want to start fresh again, so I restore from my
test data backup. This works fine.
For kicks, I tried to export the data to a new database. That worked fine.
But if I try to export data from the new database into my existing database,
I get lots duplicate key errors. I even tried setting the option to Delete
data, but that doesn't work because of foreign key constraints setup on some
of the tables.
Just curious what the recommened strategy for restoring test data is to
start anew!
2. When I make a change to the database, my collegues may have their own
test data and don't want to restore the test data that I have, but need the
database changes. What is the best way to do this? Should I just generate
the scripts for the tables I have changed?
Thanks for you help.

No comments:

Post a Comment