Re: AutoNumber ?
From: Uri Dimant (urid_at_iscar.co.il)
Date: 03/22/04
- Next message: paul reed: "Re: How to validate a query?"
- Previous message: Yiaz: "Re: Table lookup query"
- In reply to: Peter Newman: "AutoNumber ?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Mar 2004 14:19:59 +0200
Peter
You can add an IDENTITY column after yout insertion as well.
CREATE TABLE Test
(
col INT NOT NULL,
col1 CHAR(1) NOT NULL
)
GO
----Perfom lots of inserts
INSERT INTO Test VALUES (20,'a')
INSERT INTO Test VALUES (10,'b')
INSERT INTO Test VALUES (50,'c')
INSERT INTO Test VALUES (60,'d')
GO
ALTER TABLE Test ADD col_aut INT IDENTITY(1,1)
GO
SELECT * FROM Test
GO
DROP TABLE Test
"Peter Newman" <anonymous@discussions.microsoft.com> wrote in message
news:AD37C416-EF2E-4AEA-9188-A61167F2255B@microsoft.com...
> im importing a lot of records into a table. The table has no key. Id like
to make a key based on a record number. can i add a field to the table which
is an 'autonumber' field.
>
> and if so how would that effect my insert statement of
> Insert into USEDRecords ( CustNo, StartTime, FinTime) VALUES ( v1, v2,
v3)
- Next message: paul reed: "Re: How to validate a query?"
- Previous message: Yiaz: "Re: Table lookup query"
- In reply to: Peter Newman: "AutoNumber ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|