Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Gom
Starting Member
4 Posts |
Posted - 2009-04-26 : 02:16:26
|
| TB01MS04EXAT200904241832061001This is my AutoGenerate Key values on my table i have to use the check constraint for this valueIt has to check the first two letters should be char next letter should be numericit has to check vice versa according to the value i given above..How to create check constraint???if i enter the numeric values instead of charit will throw an errorerror meanscheck constraint violation error |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-04-26 : 03:30:24
|
Col1 LIKE '[a-zA-Z][a-zA-Z][0-9][0-9]%' E 12°55'05.63"N 56°04'39.26" |
 |
|
|
dineshrajan_it
Posting Yak Master
217 Posts |
Posted - 2009-04-28 : 00:30:39
|
| or thiscreate table tab(tabid varchar(20) check(patindex('[a-z A-Z][a-z A-Z][0-9][0-9]%',tabid)>0))its simillar one except replacing like statements into patindexIam a slow walker but i never walk back |
 |
|
|
|
|
|