mercredi 22 avril 2015

MSSQL - want a column to be nullable only for existing and newly created rows

Is it possible to make a column that can only be null from the beginning, but once it has been set to a non-null value then it can never be reset to null?

I'm guessing it might be possible with an update constraint using both the inserted and deleted table, but that seems somewhat complicated given the goal of the task.

Bonus question: Since it doesn't seem easy to do this, is this a sign of bad design (on the part of us / MSSQL)?

Aucun commentaire:

Enregistrer un commentaire