locked
ALTER TABLE ALTER COLUMN RRS feed

  • Question

  • Hi everyone,
      I want to change data type and length of existing column.

      I used the following query but it is in error.

         ALTER TABLE Person.Address ALTER COLUMN AddressLine2 varchar(50)
     
      AddressLine2 column is nvarchar datatype.

      The  error is:

      Msg 5074, Level 16, State 1, Line 1
      The index 'IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode' is dependent on column                     'AddressLine2'.
      Msg 4922, Level 16, State 9, Line 1
      ALTER TABLE ALTER COLUMN AddressLine2 failed because one or more objects access this column.

    If anyone knows some solutions to solve this, pls point me.

    Thanks.

    ^.^ axiom.kid4
    Wednesday, September 9, 2009 9:23 AM

Answers