|
Posted by Greg D. Moore \(Strider\) on 01/25/07 02:42
"amaxen" <Amaxen1@gmail.com> wrote in message
news:1169681707.525338.145700@13g2000cwe.googlegroups.com...
>
> When creating the table, use the Identity keyword, and an int or bigint
> type.
>
NOTE: The numbers will be sequential but not necessarily contiguous.
If you have a rollback for example the numbers wioll be "used" up.
>
> 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
>
Navigation:
[Reply to this message]
|