| Author |
Can we add null constraint to existing table
|
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
|
Can we add null constraint to existing table?
|
 |
Shinil Mohan
Ranch Hand
Joined: Aug 24, 2011
Posts: 37
|
|
Yes we can add null constraint to existing table.
ALTER TABLE `hibernate`.`billingdetails` CHANGE COLUMN `BANK_NAME` `BANK_NAME` VARCHAR(255) NOT NULL ;
ALTER TABLE `hibernate`.`billingdetails` CHANGE COLUMN `BANK_ACCOUNT_NO` `BANK_ACCOUNT_NO` VARCHAR(255) NULL ;
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3791
|
|
|
As long as the data already in the table satisfies the constraint. If it doesn't you'll have to fix the data first.
|
 |
 |
|
|
subject: Can we add null constraint to existing table
|
|
|