Skip to content

Instantly share code, notes, and snippets.

@mdamaceno
Created May 30, 2018 13:13
Show Gist options
  • Save mdamaceno/2ea0a8783d63adee4cc0412ae6408789 to your computer and use it in GitHub Desktop.
Save mdamaceno/2ea0a8783d63adee4cc0412ae6408789 to your computer and use it in GitHub Desktop.
Remove NOT NULL from a column in Firebird database
ALTER TABLE TABLE_NAME ADD COLUMN_NAME_AUX TYPE;
UPDATE TABLE_NAME SET COLUMN_NAME_AUX = COLUMN_NAME;
ALTER TABLE TABLE_NAME DROP COLUMN_NAME;
ALTER TABLE TABLE_NAME ADD COLUMN_NAME TYPE;
UPDATE TABLE_NAME SET COLUMN_NAME = COLUMN_NAME_AUX;
ALTER TABLE TABLE_NAME DROP COLUMN_NAME_AUX;
@Taki04
Copy link

Taki04 commented Apr 29, 2019

Alter table t1 alter column c1 drop not null;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment