May 15, 2007 at 1:02 pm
Hello cyber friends,
After reviewing the specs for a new project and creating approx. 18 tables, and adding data into it, the developer wants to change an int column to char. The problem is that the field is a primary key on the initial table and a foreign key on other numerous tables.
What is the best approach to fulfil this request.
Thanking you in advance, Annie G.
May 15, 2007 at 1:36 pm
1. Drop all foreign keys and constraints on the affected columns.
2. Run ALTER TABLE <tableName> ALTER COLUMN <columnName> [char].... commands for each table/column to change.
3. Re-create all constraints.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy