SQL-Server

Moderators: None (Apply to moderate this forum)
Number of threads: 435
Number of posts: 788

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Auto Sequence Posted by rikb53 on 14 Jun 2004 at 8:05 AM
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
Report
Re: Auto Sequence Posted by Sinjith_shr on 14 Jun 2004 at 8:34 PM
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(<strat limit>,<increment>)



: 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
:

Report
Re: Auto Sequence Posted by rikb53 on 15 Jun 2004 at 4:54 AM
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(<strat limit>,<increment>)
:
:
:
: : 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
: :
:
:

Report
Re: Auto Sequence Posted by rikb53 on 15 Jun 2004 at 5:53 AM
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(<strat limit>,<increment>)
:
:
:
: : 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
: :
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.