Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    IL
    Posts
    73

    Unanswered: Altering a column which has an index defined on it

    Hello,

    I'm trying the following test (which works like a charm on Oracle)

    create table x1(c1 numeric(10), c2 numeric(5,1))
    create index x1_c2_idx on x1(c2)
    alter table x1 alter column c2 numeric(9,1)

    I get the following error:
    Server: Msg 5074, Level 16, State 8, Line 1
    The index 'x1_c2_idx' is dependent on column 'c2'.
    Server: Msg 4922, Level 16, State 1, Line 1
    ALTER TABLE ALTER COLUMN c2 failed because one or more objects access this column.

    Is there a way to alter the column WITHOUT dropping the index ?



    Regards,

    Tal Olier
    otal@mercury.co.il

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    No, you must drop the index first.
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Aug 2002
    Location
    IL
    Posts
    73
    Originally posted by Paul Young
    No, you must drop the index first.
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •