B
Brian Pelton
I have two databases, Source and Target. Data will always flow from the
source to the target, never the other way around. Target database is
used for reporting.
I want to be sure that I'm not missing some ADO.NET functionality; it
seems like this is a common problem and ADO.NET might take care of it.
I have written code to pull the data for a given table from source and
from target and compare them to find the differences. This is working
just fine. To find the changes, I iterate over each row and compare
each column's values - because the Merge function doesn't do this for me.
Now that I have a DataTable that contains only the changes, I want to
update the target database. I'm my ADO.NET book, it says "If you're
deleting, inserting, and updating data with known parameters, using
Execute methods is faster than using DataAdapter's Update method."
Okay, so, now I should write SQL statements when I'm doing my comparison
because that will be faster? I thought I could just use the
DataAdapter to update Target in one shot, just by passing the DataTable
that has the changes.
Is there a better way to do this???
--Brian
source to the target, never the other way around. Target database is
used for reporting.
I want to be sure that I'm not missing some ADO.NET functionality; it
seems like this is a common problem and ADO.NET might take care of it.
I have written code to pull the data for a given table from source and
from target and compare them to find the differences. This is working
just fine. To find the changes, I iterate over each row and compare
each column's values - because the Merge function doesn't do this for me.
Now that I have a DataTable that contains only the changes, I want to
update the target database. I'm my ADO.NET book, it says "If you're
deleting, inserting, and updating data with known parameters, using
Execute methods is faster than using DataAdapter's Update method."
Okay, so, now I should write SQL statements when I'm doing my comparison
because that will be faster? I thought I could just use the
DataAdapter to update Target in one shot, just by passing the DataTable
that has the changes.
Is there a better way to do this???
--Brian