Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check Constraint
Message
General information
Forum:
Microsoft SQL Server
Category:
Database design
Title:
Check Constraint
Miscellaneous
Thread ID:
00620352
Message ID:
00620352
Views:
52
Anyone have an idea on how i can create a column check constraint on a char(15) column that only allows the digits 0-9 and the characters A-F?

In fox pro I did this...
FOR i=1 TO LEN(ALLT(THISFORM.txtnic.VALUE))
   IF !INLIST(SUBSTR(ALLT(THISFORM.txtnic.VALUE),i,1), '1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F')
      warningmessage=warningmessage+CHR(13)+'Invalid NIC address. (Non hex digit)'+' "'+SUBSTR(ALLT(THISFORM.txtnic.VALUE),i,1)+'"'
       THISFORM.txtnic.SETFOCUS
       oktosave=.F.
   ENDIF
ENDFOR
but im not sure if you can loop through each character. Any help is appreciated.

Eric Stephani
Next
Reply
Map
View

Click here to load this message in the networking platform