Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

Best way to copy data only from one database to another

I've created a database copy on our development server from a live database on our production server by doing a SQL backup and restore. I've done some work on the development server copy database by adding tables, stored procedures etc. As time's gone on though, the data on the development server is quite out of date. What's the best way of refreshing the data on the development server from the live server without losing any of my new database objects? It's only the table data I want to refresh by the way. Nothing else like stored procedures etc. as I've amended of these as well as creating new ones.
0
Grffster
Asked:
Grffster
1 Solution
 
Lawrence BarnesCommented:
I'm handling this with a cross server merge that runs on the development server and pulls data from production in small batches (so the DBA's don't hang you.)


In the source portion of your merge you create a query that morphs the production data into your development data format (additional columns, etc.) and then you use the merge to update, add or delete.

To support the batching (from production to development) you also have a query in the target portion of your merge restricing the records to the same ones as the source.

Then I while-loop these two going from batch to batch until complete...and the DBA's let me live.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now