Lightweight 0.20261105.1
Loading...
Searching...
No Matches
SqlServerTime2.hpp
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5// <sql.h> below needs a few symbols resolved first — see SqlOdbcPrelude.hpp's header comment.
6#include "SqlOdbcPrelude.hpp"
7
8#include <sql.h>
9#include <sqlext.h>
10
11// Microsoft SQL Server extension for TIME(7) with fractional seconds, for when <msodbcsql.h> is not included.
12// This is supported by SQL Server 2008 and later, MariaDB and MySQL ODBC drivers.
13// clang-format off
14#if !defined(SQL_SS_TIME2)
15 #define SQL_SS_TIME2 (-154)
16
17 /// The SQL Server ODBC extension's buffer for a @c TIME(7) value (@c SQL_SS_TIME2 in @c msodbcsql.h).
19 {
20 /// Hour of the day, 0 to 23.
21 SQLUSMALLINT hour;
22 /// Minute of the hour, 0 to 59.
23 SQLUSMALLINT minute;
24 /// Second of the minute, 0 to 59.
25 SQLUSMALLINT second;
26 /// Fractional seconds in nanoseconds (0 to 999'999'999).
27 SQLUINTEGER fraction;
28 };
29
30 static_assert(
31 sizeof(SQL_SS_TIME2_STRUCT) == 12,
32 "SQL_SS_TIME2_STRUCT size must be padded 12 bytes, as per ODBC extension spec."
33 );
34#endif
35// clang-format on
The SQL Server ODBC extension's buffer for a TIME(7) value (SQL_SS_TIME2 in msodbcsql....
SQLUSMALLINT hour
Hour of the day, 0 to 23.
SQLUSMALLINT second
Second of the minute, 0 to 59.
SQLUINTEGER fraction
Fractional seconds in nanoseconds (0 to 999'999'999).
SQLUSMALLINT minute
Minute of the hour, 0 to 59.