June 25, 2008 at 10:03 pm
Hello Everyone,
I am new to this (especially T-sql).I need to define a column in a table.I can use either varchar or char ,but my condition is positions 1-4 alpha prefix,position 5-8 numeric,9-12 alphabetic??how to give that condition in defining the column??
June 26, 2008 at 4:15 am
Dear Swekik,
Try this:
CREATE TABLE TableName (Field VARCHAR(12) CHECK (Field LIKE '[a-z][a-z][a-z][a-z][0-9][0-9][0-9][0-9][a-z][a-z][a-z][a-z]'))
cheers 😛
June 26, 2008 at 5:56 am
Why don't you have three fields?
June 26, 2008 at 7:12 am
It is Identification number like 'ABC123456YZ' ,1st three alpha numneric,nxt 6 digits like numeric,nxt 2 digits like alphabets
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply