|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 3:10 AM
Points: 17,
Visits: 105
|
|
Hi,
I need to copy data from PROD to QA between 29th Jan 6am and 10am for few tables. The Tables are replicated (transactional). How can I do it?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, February 15, 2013 1:38 PM
Points: 3,
Visits: 77
|
|
If the databases are linked, and the data is NOT in the target then just use an insert:INSERT INTO QA.dbo.table1 SELECT * FROM PROD.dbo.table1 WHERE CDate BETWEEN '1/10/2012 6:00' AND '1/10/2012 10:00'
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 10:24 AM
Points: 237,
Visits: 413
|
|
| If the servers are linked, and assuming you do not want to restart the replication, then I would recommend using the MERGE command to INSERT, UPDATE and or DELETE based on the primary key and whatever other fields you need to identify IF and WHAT the replication has not copied the records for some reason. Without knowing the nature of the data, we cannot assume its an insert, there may be updates and deletes to take care of as well.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 3:10 AM
Points: 17,
Visits: 105
|
|
CDate column is no there in the tables. What shall I do?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, February 15, 2013 1:38 PM
Points: 3,
Visits: 77
|
|
Is there no way to tell when a record was added?
Are you trying to keep two tables in sync? If so look into replication.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 3:10 AM
Points: 17,
Visits: 105
|
|
No, the tables are not in sync. Didn't find any columns that specify the time on the tables..
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Yesterday @ 4:17 PM
Points: 345,
Visits: 1,323
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 3:10 AM
Points: 17,
Visits: 105
|
|
This is actually from one of our client.
As mentioned he needs the data for that time period. Means copying the data from PROD to QA.
I just want to know is it possible to do if not I will just copy the whole db.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 7:50 AM
Points: 8,595,
Visits: 8,235
|
|
surilds (1/31/2013) This is actually from one of our client.
As mentioned he needs the data for that time period. Means copying the data from PROD to QA.
I just want to know is it possible to do if not I will just copy the whole db.
It might be possible but you have not provided anywhere near enough information. You might be able to do a point in time restore to get your database as it appeared at a given point in time. You might be able to copy certain rows if there is a way to identify what rows need to be copied. It seems like a restore from prod to QA might be ok too.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Moden's splitter.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
|
|
|
|