RegEx Column Property for Validation
It would be really awesome to have, in the properties for columns (along with datatype, computed formula, default value, etc) a property which allowed you to define a regex which would be used to check the values entered in to the column.
This would essentially function as an inherent check constraint when there was a value in this RegEx property.
Upvotes: 17<=-=Jul 17 2009 9:20AM=-=>
Thankyou for this request. Yes, this would be a neat feature to add. We have considered two approaches – either native RegEx support, or access, via SQLCLR, to the existing RegEx library available within the .NET Framework.
Anyhow, I’ll add this to our growing TODO list.
Jim Hogg<=-=Jul 17 2009 11:27AM=-=>
Cool beans! :)
I suppose as long as it supports the full regex syntax, it doesn’t really matter so much other than for possible performance implications.
Though it would be cool, if it was done natively, then T-SQL could be enhanced with the same functions to allow direct, native regex coding in SQL too. Of course, then you would also have to rewrite a whole new RegEx engine when the .NET team already has a perfectly good one written.
What to do, what to do! ;)<=-=Mar 24 2010 2:49PM=-=>
I have resolved this request as duplicate of feedback item below:
Umachandar, SQL Programmability Team