# Miscellaneous > SQL Scripts >  alter Script

## sleezy

l'm running this  script to drop and recreate my columns .But when l run it l get the following error. l want to add the column class with a 
default of 'A' but l keep gettint the above error.pLEASE HELP

Server: Msg 5074, Level 16, State 1, Line 1
The object 'DF_Ray_Class' is dependent on column 'Class'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN Class failed because one or more objects access this column.
Server: Msg 2705, Level 16, State 4, Line 2
Column names in each table must be unique. Column name 'Errno' in table 'Ray' is specified more than once.


Alter table Ray 
 drop  column
       		 Errno 
		,Errstr
		,Telno
		,NewTelNo
		,NewTelType
                ,Class
Go

Alter Table Ray Add 
       		 Errno int NULL
		,Errstr varchar (100)
		,Telno varchar (30)
		,NewTelNo varchar (20)
		,NewTelType varchar (20)
                ,Class char (3)
		    CONSTRAINT [DF_Ray_Class] DEFAULT ('A') 
Go

----------


## BrianFreeman

You need to drop the constraint before dropping the column.

alter table drop constraint DF_Ray_Class
GO

Alter table Ray 
drop column
Errno 
,Errstr
,Telno
,NewTelNo
,NewTelType
,Class
Go

Alter Table Ray Add 
Errno int NULL
,Errstr varchar (100)
,Telno varchar (30)
,NewTelNo varchar (20)
,NewTelType varchar (20)
,Class char (3)
CONSTRAINT [DF_Ray_Class] DEFAULT ('A') 
Go

----------

