Re: Identity key?
Date: Sun, 07 Jan 2001 21:49:12 GMT
Message-ID: <93ao8n$5tc$1_at_nnrp1.deja.com>
>> I have a question regarding an observation made by Joe Celko in an
article... The correct declaration should have been something like this:
CREATE TABLE US_States
Wouldn't be better to have the table like this?
CREATE TABLE US_States
No. What the hell does state_id mean in terms of a LOGICAL model? It
would just be the random order that the rows were PHYSICALLY inserted
(state_code CHAR(2) NOT NULL PRIMARY KEY,
state_name VARCHAR(15) NOT NULL UNIQUE);
(state_id IDENTITY,
state_code CHAR(2) NOT NULL PRIMARY KEY,
state_name VARCHAR(15) NOT NULL UNIQUE); <<
--CELKO--
Joe Celko, SQL Guru & DBA at Trilogy
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc)
which can be cut and pasted into Query Analyzer is appreciated.
Sent via Deja.com
http://www.deja.com/
Received on Sun Jan 07 2001 - 22:49:12 CET