-
Auto Number
Hi,
How to create an Auto Numbering column/field in MSSQL?
Thanks in advance
Xtine
-
Check out IDENTITY
e.g.
Create Table MyTable
(MyTableID INT IDENTITY (5 , 1),
SomeValue Char(10))
For this table, the column MyTableID will automatically be assigned a value from SQL. The first value that will be used will be 5 and the next value to be used will 1 more than the last value used.
You can override the value that SQL Server assigns by using the "SET IDENTITY_INSERT" command.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|