I'm trying to learn SQL with SAMS Teach Yourself SQL in 24 hours and using SQL 2000 Server but because the book is a generic SQL code I'm finding some of the examples don't work for me. Firstly is there a STORAGE command in MS SQL as when I tried to create my table and appended:STORAGE (INITIAL 20M NEXT 1M);
All I got was an error and couldn't figure how to get round it.Secondly, I created my table via:CREATE TABLE TBL_EMPLOYEE(EMP_ID CHAR(9) NOT NULL,EMP_NAME VARCHAR(40) NOT NULL,EMP_ST_ADDR VARCHAR(20) NOT NULL,EMP_CITY VARCHAR(15) NOT NULL,EMP_ST CHAR(2) NOT NULL,EMP_ZIP INTEGER NOT NULL,EMP_PHONE INTEGER NULL,EMP_PAGER INTEGER NULL);
but can't figure out how to now add a Primary Key. I added a line to my QA window:ALTER TABLE TBL_EMPLOYEE ADD CONSTRAINT EMP_ID PRIMARY KEY;
And when I parse it, it says it complete's successfully but then when I try and execute it errors.Can you see what I'm doing wrong / should I give up now?Thanks