Home Forums SQL Server 2005 Administering How do you add a constraint for a VARCHAR(10) column to checks the Date format as yyyy/mm/dd RE: How do you add a constraint for a VARCHAR(10) column to checks the Date format as yyyy/mm/dd

  • vanessa4biz (4/2/2014)


    I agree with you hundred percent but this is a legacy system and management is afraid to change the data type in fear that it may cause other problems.

    Understood. In that case (no pun intended), Michael's solution (above) will do the trick for you. It checks for format and functionality.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)