alter column table and make default value to empty string

Viewed 17960

good day.. just want to ask, is it possible to alter a column table and make the default value to empty string..

i tried using this query,

    Alter Table Employee Alter Column sJobTitle Varchar(200) DEFAULT '' 

Unfortunately, it doesn't work..

Please let me know, if 'm doing it correct..

Thanks,

Link

4 Answers
ALTER TABLE Employee 
ADD sJobTitle varchar(200) NOT NULL DEFAULT ''

simplest answer.

You can try this, single and multiple column

Single column:

ALTER TABLE `DBname`.`table_name` 
 MODIFY COLUMN `foo_name` VARCHAR(255) NOT NULL DEFAULT '';

multiple column:

ALTER TABLE `DBname`.`table_name`
 MODIFY COLUMN `foo_name` VARCHAR(255) NOT NULL DEFAULT '',
 MODIFY COLUMN `foo_roll` VARCHAR(65) NOT NULL DEFAULT '';
Related