This Query is use resequence the IDs in the GL table. It should only be necessary if the GL table has some corruption and ends up with duplicate IDs.
High. Data is modified in this query. Do not run this except under the direction of a Cyrious Technical Support staff member. Doing otherwise may result in lost or contaminated data. All data modifications done through direct SQL are permanent and non-reversable.
Notes: For faster processing, you can
-- Update Ledger Set NewID = 1 where NEWID <> 1 DECLARE @counter INT SET @counter = 1000 SET NoCount ON WHILE @counter<1000000 BEGIN UPDATE TOP (1) L SET NewID = @counter FROM Ledger L WHERE NEWID = 1 ; SET @counter = @counter + 1 END SET NoCount Off ; UPDATE Ledger SET ID = NewID WHERE ID > 0 ; SELECT top 100 * FROM Ledger