ALTER TABLE on dependent column

前端 未结 3 1900
抹茶落季
抹茶落季 2021-02-01 01:03

I am trying to alter column datatype of a primary key to tinyint from int.This column is a foreign key in other tables.So,I get the following error:


3条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 02:00

    you can drop the Constraint which is restricting you. If the column has access to other table. suppose a view is accessing the column which you are altering then it wont let you alter the column unless you drop the view. and after making changes you can recreate the view.

提交回复
热议问题