Drop a not null constraint with #SQL

By | February 15, 2018

Sometimes very annoying things can be removed with a simple SQL commands which nobody remembers because is used so rarely.

For example when we have to update a database schema and remove a not null constraint on a column.

There is a short one liner for it:

ALTER TABLE my_table ALTER COLUMN name DROP not null

Contribute to this site maintenance !

This is a self hosted site, on own hardware and Internet connection. The old, down to earth way 🙂. If you think that you found something useful here please contribute. Choose the form below (default 1 EUR) or donate using Bitcoin (default 0.0001 BTC) using the QR code. Thank you !


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.