exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 175 discussion

Actual exam question from Microsoft's 70-761
Question #: 175
Topic #: 1
[All 70-761 Questions]

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
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
References:
https://docs.microsoft.com/en-us/sql/t-sql/functions/todatetimeoffset-transact-sql?view=sql-server-2017

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
safiullah
Highly Voted 5 years, 8 months ago
I think the correct answer should be A. Because time off set between seattle and newyork is 3 hours and not 8 hours. and seattle is in 'Pacific Standrad TIme'. At time zone does the trick here.
upvoted 25 times
...
Linderen
Most Recent 4 years, 3 months ago
Isn't it B? Cause other variants don't change the returned time. select getdate() AT TIME ZONE 'Pacific Standard Time' AS A , dateadd(hh,-8,getdate()) AS B, todatetimeoffset(getdate(),'-08:00') AS C, cast (getdate() as datetimeoffset) AS D
upvoted 1 times
...
Marshy
5 years, 1 month ago
Answer should be A : SELECT GETDATE() AS CurDate, GETDATE() AT TIME ZONE 'Pacific Standard Time' AS Pacific, TODATETIMEOFFSET(GETDATE(), -8) AS Offset
upvoted 3 times
eduardogtc
4 years, 8 months ago
Besides, the argument in todatetimeoffset is wrong. It's just -8 minutes. In order to set the correct time it needs to specify '-7:00' which it's the difference from GMT declare @var_date datetime = getdate() SELECT @var_date AT TIME ZONE 'Pacific Standard Time' AS Pacific, TODATETIMEOFFSET(@var_date, '-07:00' ) AS Offset
upvoted 1 times
...
...
more
5 years, 2 months ago
c wrong there is a difference between TODATETIMEOFFSET( ....,'-08:00') and TODATETIMEOFFSET(...,-8) the other is hours and the other minutes
upvoted 1 times
...
mattia_88
5 years, 6 months ago
is possibile check this view sys.time_zone_info
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago