realbasic-nug
[Top] [All Lists]

Re: Syncing tables with no unique identifiers...? (solution?)

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Syncing tables with no unique identifiers...? (solution?)
From: "lists@mgreg.com" <lists@mgreg.com>
Date: Wed, 29 Apr 2009 19:22:11 -0400
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <D6A01D4C-61ED-4905-99F9-1D997685FB28@mac.com>
References: <E6886C9A-BB60-4E19-A396-16D980740DBA@mgreg.com> <D6A01D4C-61ED-4905-99F9-1D997685FB28@mac.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
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>


<Prev in Thread] Current Thread [Next in Thread>