Find Char nullables to possibly go for not nullables

I often find columns in tables of the databases that are defined to allow NULLs but have non NULL values. That’s actually an experience of working with constraints and when I got to understand what does it mean to have not nullable columns against nullable. The difference is big. This post gives you a wide window on this importance. 

The script finds char types columns defined to allow NULL values, but have non NULL values and generates the ALTER statements for the changes. And of course you have to check whether all generated ALTER statements will pass to be executed after checking with the other programmable parties that use the database.


Leave a Reply

Your email address will not be published. Required fields are marked *


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