Reply to Re: automatic number increment in ms sql 2005

Your name:

Reply:


Posted by amaxen on 01/24/07 23:35

When creating the table, use the Identity keyword, and an int or bigint
type.


Thus (from BOL)
IF OBJECT_ID ('dbo.new_employees', 'U') IS NOT NULL
DROP TABLE new_employees
GO
CREATE TABLE new_employees
(
id_num int IDENTITY(1,1),
fname varchar (20),
minit char(1),
lname varchar(30)
)




On Jan 24, 2:42 pm, "HandersonVA" <handerso...@hotmail.com> wrote:
> will it be possible to increase number as below automatically
> 00000001
> 00000002
> 00000003
> ...
>
> whenever the row is inserted, number will be increased like above
> format.
> which data type should I select and do some other setting to record
> like that?
> thanks

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация