|
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]
|