How To insert between Records

  • Hi.I need insert new record between records and update Id.

    I writing an accounting system.In this system sometimes user need insert new voucher between vouchers because vouchers must be sort with date and voucher number. User cannot insert into new number and sort with order by.because numbers is not sort.

    i write this query but in 200000 record very slow

    Update Fs

    Set fs.Id=Fs.id+1

    From Tbl_Vouchers Fs

    Where Fs.id>50

    I cannot use float numbering in voucher number. my voucher number must be integer.

    Thanks

  • Is the voucher number unique per row?

    I don't understand why you need to update the Id? If the Id is a true primary key, it should not be updated.

  • Ignore this. I have just seen the other post with all the answers!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply