Auto Generated TransactionID in advance.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jaydeep Ramavat
    New Member
    • Jul 2009
    • 12

    #1

    Auto Generated TransactionID in advance.

    Dear all,

    I want to generated transaction id's as follows.

    ID001
    ID002 etc.

    they should be continuous, but the problem is that it is required to be created in advance(before actual record added into the database), and also able to work in multi user environment.

    is it possible to generate like this?

    Thanks.
    Jaydeep.
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    Originally posted by Jaydeep Ramavat
    Dear all,

    I want to generated transaction id's as follows.

    ID001
    ID002 etc.

    they should be continuous, but the problem is that it is required to be created in advance(before actual record added into the database), and also able to work in multi user environment.

    is it possible to generate like this?

    Thanks.
    Jaydeep.
    For these purposes create a stored procedure..
    set the isolation level of the stored Procedure ...

    for transactional Stored Procedures...

    fetch the last transaction id from the table increment it by one ... and then store it into the table...

    Note: ID generation should always be done at database level so that you tend to get the most accurate data

    Comment

    Working...