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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Regular expression support check contraint feature

Author  Topic 

tswern
Starting Member

10 Posts

Posted - 2003-03-08 : 06:46:30
Does MS SQL support full blown Regular expression features under SQL CHECK CONTRAINTS ? What limit does it have on regular expression features?

Save the dugongs!

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-03-08 : 07:12:14
Sorry, no regular expressions yet.
Maybe in the next release.

Damian
Go to Top of Page

Onamuji
Aged Yak Warrior

504 Posts

Posted - 2003-03-08 : 07:27:33
actually check this out :)

http://www.codeproject.com/useritems/xpRegex.asp

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-03-08 : 13:07:34
Nice!
Thanks for the link Onamuji

Go to Top of Page

tswern
Starting Member

10 Posts

Posted - 2003-03-09 : 00:38:31
Thanks onamuji! Cool link. Now... lets see whether it works with Check Constraints..

Save the dugongs!
Go to Top of Page

Onamuji
Aged Yak Warrior

504 Posts

Posted - 2003-03-09 : 09:01:19
it should .. since its an extended stored procedure .. you can write a UDF to do the constraint check and return either 0 or 1 or any value you want ... since UDFs can call XP's :)

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-03-09 : 10:29:31
And unless you have some really intricate reg exp's to process, you can use a regular LIKE match in a check constraint. There really is a lot you can do with LIKE.

Go to Top of Page
   

- Advertisement -