title: Data Validation Stored Procedure in SQL Server 2005
body: <p>I would like to get the Date of Birth Value in the stored procedure parameter and validate/filter it if its after 1910 and current year -18 yrs. If it is not then i want to pass/insert the null value. Here is my stored proc without any validation:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[CARS_IS_WU_T_INSERT](
  
  
             @DOB                           [DATETIME],
             @SSN                           [VARCHAR](9),
             @OCCUPATION                    [VARCHAR](30),
             @PLACE_OF_ISSUANCE             [VARCHAR](30),
             @Exception_Bit                 [BIT])
  AS
  INSERT INTO [DBO].[UA_T]
           (
            [DOB],
            [SSN],
            [OCCUPATION],
            [PLACE_OF_ISSUANCE],
            [EXCEPTION_BIT])
    VALUES     (
    @DOB,
            @SSN,
            @OCCUPATION,
            @PLACE_OF_ISSUANCE,
            @Exception_Bit)
  </code></pre>