Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Auto Sequence

rikb53rikb53 Posts: 64Member
hey guys, need a little help here.
in oracle i would create a sequence, in access i could name a key column to autoincrement.
but i cant find either in sql server 2000

most of sql, i can just apply oracle comands and DDL

like: CREATE SEQUENCE empl_id_sew
INCREMENT BY 1
START WITH 1
MAX VALUE 9999
NOCACHE
NOCYCLE;

but, sql must be different.
any help is appreciated
thanks
rik

Comments

  • Sinjith_shrSinjith_shr Posts: 6Member
    Hi friend
    In SQL there is property fro the table to get column auto increment. u can create a identity constraint in SQL and specify the squence of increment and start limit.

    from enterprise take table design select the column then in the down there will be so many properties like identity,default there u asssign the idenetity
    from query

    columnname identity(,)



    : hey guys, need a little help here.
    : in oracle i would create a sequence, in access i could name a key column to autoincrement.
    : but i cant find either in sql server 2000
    :
    : most of sql, i can just apply oracle comands and DDL
    :
    : like: CREATE SEQUENCE empl_id_sew
    : INCREMENT BY 1
    : START WITH 1
    : MAX VALUE 9999
    : NOCACHE
    : NOCYCLE;
    :
    : but, sql must be different.
    : any help is appreciated
    : thanks
    : rik
    :

  • rikb53rikb53 Posts: 64Member
    thanks so much for the response. well, that's why i was wondering. i had everything done the way you said, and it kept saying that it couldnt do the insert while the identity_insert property was set to off.
    and i had explicitly run:
    set indentity_insert remarks on
    i'm wondering if it just hasnt updated some other part of sql server?
    anway, at least i was on the right track.
    and i really do appreciate your help here.
    thanks again
    rik


    : Hi friend
    : In SQL there is property fro the table to get column auto increment. u can create a identity constraint in SQL and specify the squence of increment and start limit.
    :
    : from enterprise take table design select the column then in the down there will be so many properties like identity,default there u asssign the idenetity
    : from query
    :
    : columnname identity(,)
    :
    :
    :
    : : hey guys, need a little help here.
    : : in oracle i would create a sequence, in access i could name a key column to autoincrement.
    : : but i cant find either in sql server 2000
    : :
    : : most of sql, i can just apply oracle comands and DDL
    : :
    : : like: CREATE SEQUENCE empl_id_sew
    : : INCREMENT BY 1
    : : START WITH 1
    : : MAX VALUE 9999
    : : NOCACHE
    : : NOCYCLE;
    : :
    : : but, sql must be different.
    : : any help is appreciated
    : : thanks
    : : rik
    : :
    :
    :

  • rikb53rikb53 Posts: 64Member
    okay, figured it out. just TRUNCATED the table and started over. i must have missed a step somehow. anyway, it works perfectly now.
    thanks again for your help
    rik


    : Hi friend
    : In SQL there is property fro the table to get column auto increment. u can create a identity constraint in SQL and specify the squence of increment and start limit.
    :
    : from enterprise take table design select the column then in the down there will be so many properties like identity,default there u asssign the idenetity
    : from query
    :
    : columnname identity(,)
    :
    :
    :
    : : hey guys, need a little help here.
    : : in oracle i would create a sequence, in access i could name a key column to autoincrement.
    : : but i cant find either in sql server 2000
    : :
    : : most of sql, i can just apply oracle comands and DDL
    : :
    : : like: CREATE SEQUENCE empl_id_sew
    : : INCREMENT BY 1
    : : START WITH 1
    : : MAX VALUE 9999
    : : NOCACHE
    : : NOCYCLE;
    : :
    : : but, sql must be different.
    : : any help is appreciated
    : : thanks
    : : rik
    : :
    :
    :

Sign In or Register to comment.