Home » Microsoft » MB6-886 » What should you include in the design?
You are designing a table to store date and time information for an application. The application will be used by users in Europe, Asia, and North America.
You need to add a column that stores the date and time information for all users. The column must contain information that can be used to identify the users’ local time zone.
What should you include in the design?
A. a getutcdate function
B. a sysdatetimeoffset function
C. a datetime2 data type
D. a datetimeoffset data type
Correct Answer: D
Explanation/Reference:
You should use a datetimeoffset data type because it defines a date that is combined with a time of a day that has time zone awareness.
You should not use a datetime2 data type because it does NOT keep time zone offset range.
You should not use a getutcdate function because it returns the current database system timestamp as a datetime value (this value represents the current UTC time) and the database time zone offset is not included.
You should not use a sysdatetimeoffset function because it returns a datetimeoffset value that contains the date and time of the computer on which the instance of SQL Server is running. We are not interested in the time of the computer on which the instance of SQL Server is running, we need to know users’ local time zone.
In this case the application should provide this information.