I know this is probably a stupid post but I cannot think of how to accomplish this. How do you do the equivilent to an autonumber in a SQL Server table? Please let me know my project is very close to deadline
Thanks in advance
Recommended Answers
Jump to PostOk, just to clarify? Replicate autonumber in SQL how? You mean within an SQL function/store procedure or in another coding lanuage (if so which one)?
IDENTITY(x,y) is how you use autonumber in SQL ( x = starting point, and y = increment by)
Jump to PostWell kind of.
Ok here is the syntax on creating a table in SQL and having an autonumber column
CREATE TABLE NorthWindUsers (UserID INT IDENTITY(1,1) NOT NULL, UserName VARCHAR(50) NOT NULL, Password VARCHAR(50) NOT NULL)
The userID will start a 1, and increment each time you …
Jump to PostYou know, this feature isn't in Oracle as I recently discovered. Is it considered bad to use autoincrementing numbers? Certainly makes it easy to maintain a primary key with little effort. I am just trying to understand in what situation you wouldn't want to use that feature. Obviously Oracle doesn't …
All 11 Replies
Paladine
138
Master Poster
Team Colleague
Madmax
0
Newbie Poster
Paladine
138
Master Poster
Team Colleague
relawson
0
Newbie Poster
Troy
35
Posting Whiz
relawson
0
Newbie Poster
Troy
35
Posting Whiz
relawson
0
Newbie Poster
jwshepherd
0
Junior Poster
Zandyke
0
Newbie Poster
hgdfjguigh
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.