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

  • dirk.dromgoole (8/20/2014)


    I have thought about a table valued function or trigger or something like that which will automatically update the date to end of day. The inserts will be done manually so a failure on insert will not be such a big deal and whomever does the inserts will just have to look at the constraint. Although, it would be nice not to have to worry about that and that's why I'm looking for any suggestions on best possible solution.

    As data stewards our job is to NOT change data but to retrieve it accurately. Changing data so it can be queried is a sign that the query needs to be changed. Accurate data is critical to many things and it should be treated as sacred.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/