On Apr 24, 2009, at 5:08 AM, Tom Benson wrote:
Do you have access to the original database??
If so, add a unique identifier right now by executing the following:
ALTER TABLE 'poorly_designed_table' ADD 'unique_value' timestamp NOT
NULL on update CURRENT_TIMESTAMP;
This field value should get automatically populated as new entries
are added by the original app, making it easy for you to do your
syncing in the future.
- Tom Benson
---------------------------------------------------------------
Custom Controls & Code Libraries
for REALbasic version 5.5 and up
http://www.qedit.com.au
Yes, I do have access to it. I've actually run into another problem
related to TIMESTAMPs though. Sometimes multiple rows get logged
"simultaneously" and tables with existing TIMESTAMP fields will post
repeat results (and I really don't want it to prevent a new post
simply because of the same TIMESTAMP). So timestamps in general might
not be the best. But that leads me to a couple of other questions:
1) Does MS SQL Server keep track of hidden ROW_IDs natively?
2) Is there any way to create a unique row identifier such that even
when the DB is backed up and flushed, it will not reuse them? For
example, if I back up rows 1-1000 and wipe the table, can I keep going
with 1001?
3) Also, currently I'm simply using RB Database objects to obtain the
source table and field schemas and map the field type with as close an
equivalent as possible to the target DB's type. It's working decently
well, but it's a bit slower than desired. So, I'm looking for some
shortcuts. Are there any good "export entire table as INSERT ROW IF
NOT EXISTS" methods?
Thanks,
Michael
NOTE: I realize this thread might tread outside the realm of RB, so
if you feel more comfortable contacting me off-list feel free. I will
post any important findings back to the list as I see fit.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|