I just created a new table and I want to remove the 'person' column in it but I get an error -
CREATE TABLE new_info( info_id INT IDENTITY (1,1) PRIMARY KEY, title VARCHAR(500) NOT NULL, person VARCHAR(50) NOT NULL UNIQUE ) And after this -
ALTER TABLE new_info DROP COLUMN person; I get this error -
Msg 5074, Level 16, State 1, Line 1 The object 'UQ__informat__DC4560C2776204D1' is dependent on column 'person'. Msg 4922, Level 16, State 9, Line 1 ALTER TABLE DROP COLUMN person failed because one or more objects access this column. Any Idea why, or what's causing this ?
'person' is not a constraint.UQ__informat__DC4560C2776204D1is a constraint you need to remove firstCONSTRAINT, @Ileh . It's good habit to name them, so that you don't get "unfriendly" names like that for your objects.