SQL Flow Field Guide

datetime (data type)

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

data type datetime

What changes

Input
none
Output or change
none

Syntax at a glance

datetime

Work example

Read a legacy timestamp column while maintaining an existing contract.

Use datetime2 for new timestamp columns when an offset is not part of the stored value.

Check your work datetime rounds to coarse fractional-second increments and has a narrower range than datetime2.

Practice SQL

Open in SQL Flow
SELECT CAST('2026-04-05T12:30:00' AS datetime) AS legacy_time;

Open Microsoft Learn for full syntax, permissions, and details for your version.