RE: FN-FORUM: Autonumber in sql server
date posted 22nd January 2007 09:19
may I request to come off the mailing list please?
Thanks
Niketa Akintade
>From: Andrew Bibby [EMAIL REMOVED]
>Reply-To: [EMAIL REMOVED]
>To: "FN-FORUM / [EMAIL REMOVED] [EMAIL REMOVED]
>Subject: RE: FN-FORUM: Autonumber in sql server
>Date: 21 Jan 2007 16:43:10 -0000
>
>
> >> I'm using SQL Server Express Edition and was wondering if anyone here
>knew
>how to create an autonumber start at a set number as opposed to the default
>0, for example start counting from 1000 instead of 0?
>
>_________________________________________
>
>
>James,
>
>If you're using SQL to create the table, you can do it in the create
>script,
>for example:
>
>CREATE TABLE dbo.Table_1
> (
> Table_1ID int NOT NULL IDENTITY (1000, 1),
> TableCol1 nchar(10) NULL,
> TableCol2 nchar(10) NULL
> ) ON [PRIMARY]
>GO
>
>The first parameter after the IDENTITY statement (IDENTITY is what SQL
>Server calls an autonumber) is the 'seed' value - the value at which the
>identity starts. So in the example above, the first id would be 1000, then
>1001, 1002, and so on.
>
>Cheers,
>Andrew.
>
>--
>_____________________________
>Andrew Bibby
>I.T. Solutions Ltd
>http://www.itsolutions.uk.com
>
>
>
>
>--
>Freelancers, contractors earn more with Prosperity4
>Call 0870 870 4414 or visit www.prosperity4.com
>and benefit from Inland Revenue approved expenses today.
>
>To advertise here: http://www.freelancers.net/advertising.html
>
>