Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make my ID field start from a specific number

Status
Not open for further replies.

blaises

Technical User
Sep 29, 2003
9
GB
Hi all,

I have an order table in my database and need to make the OrderId field entry start from a 5 figure number with an increment of 1. Any ideas how I can do this?

 
In design mode of the table you have an Identity Seed and an Identity Value. For your case we would set the Seed to 5 and the Value to 1


Thanks

J. Kusch
 
Blaises,

When you make your table, just put these options for your id field:
Data Type: bigint (any integer is ok, but if you start with 5 digits, you better keep it a bigint)
Identity: Yes
Identity Seed: 10000
Identity increment: 1

Regards,
Johpje
 
You can use BigInt if you are running SQL Server 2000. SS7 does not have the BigInt datatype.

Thanks

J. Kusch
 
Many thanks for all yor responses. Unfortunately I think I posted this questing to the wrong forum. This is suppose to be a MysQl question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top