Date and Time
Data Type | Size (bytes) | Example | Notes | Client Providers |
DATE | 3 | '2009-10-01' | OLEDB: DBTYPE_DBDATE | |
TIME | 3-5 | '13:12:00.1234567' | Accurate to 100 nanoseconds | OLEDB: DBTYPE_DBTIME |
DATETIME2 | 6-8 | '2009-10-01 13:12:00.1234567' | Accurate to 100 nanoseconds | OLEDB: DBTYPE_DBTIMESTAMP |
DATETIMEOFFSET | 8-10 | '2009-10-01 13:12:00.1234567+02:00' | Accurate to 100 nanoseconds | OLEDB: DBTYPE_DBTIMESTAMP |
There are a number of new functions which can also be used with these new datatypes including:
- SYSDATETIME (returns DATETIME2), SYSUTCDATETIME, SYSDATETIMEOFFSET (includes time zone in return value) – Current Date and Time
- SWITCHOFFSET – to change the timezone for a DATETIMEOFFSET value
- TODATETIMEOFFSET – convert non-timezone-aware values to time-zone-aware
Other
Data Type | Size (bytes) | Useage | Returns | Notes |
HIERARCHYID | VARBINARY | DECLARE @h hierarchyid = hierarchyid::GetRoot() DECLARE @c hierarchyid
| '/1/' | Represents position in a hierarchy Actually a CLR function with several methods eg
|
No comments:
Post a Comment