Force newly updated rows from a source to a target database?
pclaar
Posts: 2 New member
I've been using SQL Data Compare for years but I can't figure out a way to do this simple task...
I'm updating rows in my source database and it has a column called "DateUpdated". This field will get set to today's date when new data is written to the row, either by insert or update.
So for SQL Data Compare, I only want to compare the rows where "DateUpdated" is >= (today). The key from the source and destination database should match and there would be an update (DateUpdated is not part of the key.). If there is no match, insert it.
Here's how I've tried to set it up...
1. In the Tables and Views dialog, I've set the Comparison Key for the table to be the key that matches the rows between the source and target.
2. For the WHERE clause, I've tried two things: " DateUpdated >= '2024/12/3' " for both tables, or " DateUpdated >= '2024/12/3' " for just the source table.
3. If also tried to remove some of the Columns for Comparison, but if I remove them, the updates for these columns don't get deployed.
I feel like I'm missing something basic. Anyone have some advice or is this just not possible without having to compare a much larger subset of rows?
I'm updating rows in my source database and it has a column called "DateUpdated". This field will get set to today's date when new data is written to the row, either by insert or update.
So for SQL Data Compare, I only want to compare the rows where "DateUpdated" is >= (today). The key from the source and destination database should match and there would be an update (DateUpdated is not part of the key.). If there is no match, insert it.
Here's how I've tried to set it up...
1. In the Tables and Views dialog, I've set the Comparison Key for the table to be the key that matches the rows between the source and target.
2. For the WHERE clause, I've tried two things: " DateUpdated >= '2024/12/3' " for both tables, or " DateUpdated >= '2024/12/3' " for just the source table.
3. If also tried to remove some of the Columns for Comparison, but if I remove them, the updates for these columns don't get deployed.
I feel like I'm missing something basic. Anyone have some advice or is this just not possible without having to compare a much larger subset of rows?
Tagged:
Answers
If I set the WHERE clause in the source database only, I get the result I want...
...if I uncheck the 81819 records. But this is hugely inefficient since I have to read each and every row from the target database.