Walter Meester
HoogkarspelNetherlands
General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi mark,
I don't think your proposal is neccesary and might cause problems when deleting a certain record twice.
If in your case, the deleted records in the target table is the only problem, I think by filtering the PK on deleted() will solve your problems nice and clean.
Just give it a test: Open the target table exclusively, open it in de table designer (MODIFY STRUCTURE), go to the indexes tab, select the primary key, and type: !DELETED() in the filter column.
For rushmore optimizations reasons, add another regular index on the primary key: (For example: INDEX ON MyPrimaryKey TAG PK2 )
No just try what you're trying to do again.
Hope this helps.
Walter,
>How does this sound as a solution to my updating problem using surrogate keys.
>
>To avoid getting an update problem I convert the PK in my target table to a minus amount. I then delete the record and cascade any deletes that are neccesary if more tables are involved.
>
>Because the deleted records in the target table now have a different PK I can append in my new records (which contain the original positive PK)
>
>I realise that this can be a bit inefficient in some circumstances but I can think of a lot of circumstances where it would be the simplest way.
>
>Assigning a minus PK to deleted records would also have the advantage of allowing me to start recycling deleted records again like I did in the old days.
>
>Am I about to make a big mistake .
>
>Please let me know
>
>Thanks:)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only