0

I am trying to change the data type of a primary key in table A from INT(11) to CHAR(11). However, this primary key is a foreign key in tables B and C. SQL is giving me an error whenever I try to change the value type of the primary key. Here is the query that I tried:

ALTER TABLE CUSTOMER CHANGE CUSTID CUSTID CHAR( 11 ) NOT NULL

The error I am getting is #1025. Do I need to use a double nested query to change its data type in tables A, B, and C? I'm a bit lost here.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by BThomps
1

Drop the foreign key relations.
Modify all three tables to the same data type.
Re-create the foreign key relations.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.