Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Alter table

Author  Topic 

flow_boarder
Starting Member

1 Post

Posted - 2008-11-04 : 21:01:32
this is the table i created.

create table ADVISEMENT(
STUDENT varchar(32) not null,
INSTRUCTOR varchar(32) not null,
LAST_ADVISMENT_DATE date not null,
STATUS char(6) not null
check (STATUS in ('Met', 'Missed')));


i am trying to alter the table so that i can also add a STATUS 'Unknown'. this is my alter table, but i am unable to get it to work.


alter table ADVISEMENT add (constraint IN_ADV
check (STATUS in ('Met', 'Missed', 'Unknown')));

Jason100
Starting Member

34 Posts

Posted - 2008-11-04 : 22:10:05
Maybe you can run the following sql

alter table ADVISEMENT drop constraint CK_STATUS

ALTER TABLE ADVISEMENT ADD CONSTRAINT CK_STATUS CHECK (STATUS IN( 'Met','Missed','Unknown'))
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-04 : 23:31:51
what was the error you got?
Go to Top of Page
   

- Advertisement -