locked
Getting Error while modiying partition key column RRS feed

  • Question

  • Hi ,

    I have a Database in that every table has one column called Year, All tables are portioned on the year. Now when I alter all the table making it as null "

    ALTER

    TABLExx ALTERCOLUMNyear INTNULL

    It was not given any error but when I am trying to NOT NULL

    ALTER

    TABLExx ALTERCOLUMNyear INTNULL

    Its Giving error :

    Msg 5074, Level 16, State 1, Line 1

    The object xx is dependent on column year.

    Msg 4922, Level 16, State 9, Line 1

    ALTER TABLE ALTER COLUMN year failed because one or more objects access this column.


    Regards Vikas Pathak

    Tuesday, September 22, 2015 3:23 PM

Answers

  • Hi Vikas,

    I test the scenario as yours and get the same message as follows.

    The object 'Tablename' is dependent on column 'year'.

    It is not supported in SQL Server to alter the partition key column from NULL to NOT NULL. To work around this issue, you can rebuild your table with a new partition scheme and transfer the data. For more details about the process, please review this blog.

    Thanks,
    Lydia Zhang


    Lydia Zhang
    TechNet Community Support


    Wednesday, September 23, 2015 9:55 AM