Hello.
I'd like to constrain a table column to be either 11 numeric digits long or null. Though it's not strictly correct I can make the column Int to force numeric values but it's specifying Length within the constraint I'm having problems with. I've spent a while trying to achieve this but something about my contraint syntax is wrong. Can anyone help please.
This is what it feels like the costraint should be.
(LENGTH[column1] = 11) OR [column1] IS NULL)
I've tried putting LENGTH(column1) inside the left hand square brackets but that does'nt work either.
I'd like to constrain a table column to be either 11 numeric digits long or null. Though it's not strictly correct I can make the column Int to force numeric values but it's specifying Length within the constraint I'm having problems with. I've spent a while trying to achieve this but something about my contraint syntax is wrong. Can anyone help please.
This is what it feels like the costraint should be.
(LENGTH[column1] = 11) OR [column1] IS NULL)
I've tried putting LENGTH(column1) inside the left hand square brackets but that does'nt work either.