hi,
i have a field named 'nim', in my table which is a char(10) field.
i want to create a constraint that checks the field so the field must be 10 characters long and each character is a number.
i can only think of nim like '[0-9][0-9][0-9] .... [0-9]' . i can't use isnumeric() because it may still accept dot character right? anyway i've tried to use the isnumeric function but i get this " error Incorrect syntax near ')' ".
i don't know what's wrong with this line
thank you very much.
i have a field named 'nim', in my table which is a char(10) field.
i want to create a constraint that checks the field so the field must be 10 characters long and each character is a number.
i can only think of nim like '[0-9][0-9][0-9] .... [0-9]' . i can't use isnumeric() because it may still accept dot character right? anyway i've tried to use the isnumeric function but i get this " error Incorrect syntax near ')' ".
i don't know what's wrong with this line
Code:
CONSTRAINT checkNIM CHECK ( len(nim)=10 and isnumeric(nim) )
thank you very much.
Comment