• Sean Lange (5/6/2013)


    kapil_kk (5/6/2013)


    Hi, I have a scenario in which I am performing insertion on a table using a stored procedure. For every insertion there is a ID generation for the rows like if a quantity is 100 then for 100 rows there will be a single transaction ID as there will be 100 unique vouchers. Suppose if I inserted 1000 rows who should get ID 001 but on another screen I am again performing inserting then it should get another unique Id say 002 but I am getting same ID for both windows.

    How to achieve this plz tell?

    Kapil I am not quite understanding what you are doing here. Can you please try to explain more clearly the situation?

    Here is the some sample data of some columns from my table.. See if quantity is 5 then 5 unique voucher no gets genearted but they have same transaction Id. the problem that I ma facing is that if I entered quantity >1000 and while inserting if start inserting in another window for quantity e.g 100 then both these insertion gets same transaction ID.

    Hope its clear to you now

    VoucherIdVoucherNoTransactionIDQuantityAmountValue

    4VVD0000001TRN00000025400

    5VVD0000002TRN00000025400

    6VVD0000003TRN00000025400

    7VVD0000004TRN00000025400

    8VVD0000005TRN00000025400

    9VVD0000006TRN00000035400

    10VVD0000007TRN00000035400

    11VVD0000008TRN00000035400

    12VVD0000009TRN00000035400

    13VVD0000010TRN00000035400

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/