November 12, 2010 at 5:48 am
Hi All..
I have to change datatype of a column in many tables. Now the problem is the column is a composite key. I have dropped the constraint then tried changing the datatype, server throws back error
Server: Msg 5074, Level 16, State 8, Line 1
The statistics 'ABC' is dependent on column 'ABC'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE ALTER COLUMN ABC failed because one or more objects access this column.
There are loads of data in many tables. So I have to be sure no data is lost also.
I have checked in sysreferences no table is referencing this table.
I am chaniging datatype from smallint to INT.
Please help.
Thanks,
Harsha
November 12, 2010 at 6:00 am
Drop the index which was created on the column being dropped/modified.
Also check, may be index was created on coposite key, if its there... drop the index then change the datatype and re-create the index.
November 12, 2010 at 7:25 am
Hi,
Thanks for the quick reply and it did help.
Now a new problem is there...
With the same column name I have got lots of tables and in sysindexes there are 23 rows with same column name but with different name:(
November 12, 2010 at 7:35 am
Hi,
I use the delete statement after sp_configure...
thanks for the help...
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply