This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi folks, How hard is it to change the Identity method to KeyTable after a database has been created and populated using the IdentityColumn method (in SQL Server)? Is this going to mean re-allocating Ids to all existing records in all tables, or can I just grab some new arbitrary number as the new starting point? I just discovered (after many months of happily using LS with the identityColumn method) that a certain problem I'm having (keeping track of newly added records after saving and refreshing BindingSources) would be easily solved if I had been using the KeyTable method... Lucien. |
|
|
There should be no problem as long as you start your KeyTable with a value that is higher than any ID currently in the system (or, at least, in any table that you're switching over to KeyTable). LightSpeed doesn't care that the existing IDs came from a different source, all it cares about it that it can assign new IDs that won't clash. Obviously, you will also need to change the ID columns to no longer be identity columns. |
|
|
Thanks, Ivan. I was hoping that would be true. So the KeyTable is really only used to allocate new IDs, not to identify existing records in any way? Obviously there will be plenty of records (from different tables, of course) with the same ID... Lucien. |
|
|
That's right. LightSpeed consults the KeyTable only when it needs to allocate an ID (that is, when a new entity is added to a unit of work). Put another way, identity methods don't affect the way LightSpeed interprets ID values, only how it creates those ID values in the first place. |
|