Oracle trigger to SQL trigger

  • That trigger emulates what a column with an identity does... so you can simply define the column as having an identity and skip the trigger completely.

    Create table tbname (colname int identity(1,1) not null.........

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (3/5/2013)


    That trigger emulates what a column with an identity does... so you can simply define the column as having an identity and skip the trigger completely.

    Create table tbname (colname int identity(1,1) not null.........

    Given that this is a SQL 2012 forum, the OP can also use the new SEQUENCE object, which could be the only feature that gives the exact same implementation. The Oracle sequence could well be something other than int from 1 to N increment by 1.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

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

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