You have a project management application. The application uses a Microsoft SQL Server database to store data. You are developing a software bug tracking add-on for the application.
The add-on must meet the following requirements:
?- Allow case sensitive searches for product.
?- Filter search results based on exact text in the description.
?- Support multibyte Unicode characters.
You run the following Transact-SQL statement: Users connect to an instance of the bug tracking application that is hosted in New York City. Users in Seattle must be able to display the local date and time for any bugs that they create.
You need to ensure that the DateCreated column displays correctly.
Which Transact-SQL statement should you run?
A . SELECT Id,Product,DateCreated AT TIME ZONE ‘Pacific Standard Time’ FROM Bug
B . SELECT Id,Product,DATEADD(hh, -8, DateCreated)FROM Bug
C . SELECT Id,Product,TODATETIMEOFFSET(DateCreated, -8)FROM Bug
D . SELECT Id,Product,CAST(DateCreated AS DATETIMEOFFSET)FROM Bug
Answer: C
Explanation:
References: https://docs.microsoft.com/en-us/sql/t-sql/functions/todatetimeoffset-transact-sql?view=sqlserver-2017