Home Forums SQL Server 2005 Development datetime check constraint for 23:59:59.997 RE: datetime check constraint for 23:59:59.997<!-- 864 -->

  • Lynn Pettis (8/20/2014)


    As this was posted in a SQL Server 2005 forum the DATE data type is not available in this version of SQL Server.

    The following check constraint should work in a similar way under SQL Server 2005.

    create table #t

    (

    EndDate datetime

    constraint ck_EndDate check (EndDate = convert(char(8),EndDate,112))

    );

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho