Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Request: Rule for host-specific datetime use #320

@lowlydba

Description

@lowlydba

A rule that checks for GETDATE(), SYSDATETIME(), etc. usage that is dependent on the OS's settings for time zones. Best practice would be to utilize strict UTC (SYSUTCDATETIME(), etc.) and convert from there (inline or in client) as needed. This avoids issues from changes made outside of the SQL Server instance and follows broad best practice wisdom to store/use UTC wherever possible.

sys.time_zone_info can help greatly with this best practice approach and is available on 2016+. The only version in current support without it is 2014 (until 2024), so this best practice approach should be feasible for most MS supported installs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions