Add check constraint for web addresses to SQL 2000
Account Home | Help | Blog | Contact us | Log Out


Welcome to Kbytes > Articles

Add check constraint for web addresses to SQL 2000

Posted By: siteadmin on 23/03/2012 22:05:00

Without the luxury of Regex functions in MS SQL 2000 you can still use check constrains to apply formatting to your table columns.

Here is the check constraint phrase to ensure a web address, with a trailing / is entered:

 

([col] like '%://%/')

and then

({ fn LENGTH(col) } - { fn LENGTH(REPLACE(col, '/', '')) } > 3)

 


blog comments powered by Disqus

Kbytes Home | Privacy Policy | Contact us | Testing Area

© 2004 - 2024 1 Oak Hill Grove Surbiton Surrey KT6 6DS Phone: +44(020) 8123 1321