Hello,
I have about 150 databases where I need to change the a stownship column from char(7) to char(3). I am running
But I get the following error:
Server: Msg 5074, Level 16, State 1, Line 1
The object 'tblLandTownshipDefault' is dependent on column 'stownship'.
Server: Msg 5074, Level 16, State 1, Line 1
The index 'idxTownship' is dependent on column 'stownship'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE ALTER COLUMN stownship failed because one or more objects access this column.
Is there a way I can do this with SQL queries? I can alter the column length in enterprise manager just fine. It gives me some messages, but still allows it to go through.
I'm hoping to avoid doing this in enterprise manager and just run queries on all of the databases. Is there a way around these erors?
Thanks!
Brian
I have about 150 databases where I need to change the a stownship column from char(7) to char(3). I am running
Code:
alter table tblland alter column stownship char(3)
But I get the following error:
Server: Msg 5074, Level 16, State 1, Line 1
The object 'tblLandTownshipDefault' is dependent on column 'stownship'.
Server: Msg 5074, Level 16, State 1, Line 1
The index 'idxTownship' is dependent on column 'stownship'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE ALTER COLUMN stownship failed because one or more objects access this column.
Is there a way I can do this with SQL queries? I can alter the column length in enterprise manager just fine. It gives me some messages, but still allows it to go through.
I'm hoping to avoid doing this in enterprise manager and just run queries on all of the databases. Is there a way around these erors?
Thanks!
Brian