UltraSmooth
Programmer
I'm trying to modify some columns using an sql script. The columns are part of the primary key or indexes of the table. How can I do this with a script, I know I can do it with Enterprise Manager.
When I use the following:
alter table master
alter column [ID] varchar(3);
I get the following error:
Server: Msg 5074, Level 16, State 8, Line 1
The object 'PK_master' is dependent on column 'ID'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE ALTER COLUMN ID failed because one or more objects access this column.
I guess I could always drop/disable the keys and recreate them again. Any other way without do maybe force it?
When I use the following:
alter table master
alter column [ID] varchar(3);
I get the following error:
Server: Msg 5074, Level 16, State 8, Line 1
The object 'PK_master' is dependent on column 'ID'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE ALTER COLUMN ID failed because one or more objects access this column.
I guess I could always drop/disable the keys and recreate them again. Any other way without do maybe force it?