DATETIME2= Data Set Option

Specifies the scale for the timestamp literal for Microsoft SQL Server 2008 and the native Microsoft driver.

Valid in: DATA and PROC steps (when accessing DBMS data using SAS/ACCESS software)
Category: Data Set Control
Default: NO
Data source: Microsoft SQL Server, ODBC
See: DATETIME2= LIBNAME option

Table of Contents

Syntax

DATETIME2=YES | NO

Syntax Description

YES

specifies a DATETIME precision and scale when creating the timestamp for the WHERE clause.

NO

uses the first occurring DATETIME precision and scale when creating the timestamp for the WHERE.

Last updated: February 3, 2026