Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

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.

0 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    AdminMicrosoft SQL Server (Admin, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    unplanned  ·  AdminMicrosoft SQL Server (Admin, Microsoft Azure) responded  · 

    Upvotes: 17

    <=-=Jul 17 2009 9:20AM=-=>

    Hi,

    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.

    Thanks,

    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=-=>

    Hi,
    I have resolved this request as duplicate of feedback item below:

    https://connect.microsoft.com/SQLServer/feedback/details/261342/regex-functionality-in-pattern-matching?wa=wsignin1.0


    Umachandar, SQL Programmability Team

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base