PrepAway - Latest Free Exam Questions & Answers

How would you accomplish this?

You work as a SQL Server 2012 database administrator at ABC.com. You have developing a
database named WebAnDB that will be used by a web site analysis application. The WebAnDB
database has a table named Visitors that stores date and time data in a column named Accessed.

You must now develop a stored procedure that will insert data into the Accessed column. You
want the stored procedure to store time zone data as well.
How would you accomplish this?

PrepAway - Latest Free Exam Questions & Answers

A.
You should make use of a scalar user-defined function.

B.
You should make use of the SET CONTEXT_INFO statement in the stored procedure.

C.
You should make use of the DATETIMEOFFSET data type.

D.
You should make use of the TODATETIMEOFFSET function.

E.
You should make use of the SET FORCEPLAN ON statement in the stored procedure.

F.
You should make use of a cursor.

Explanation:

5 Comments on “How would you accomplish this?

  1. Matador says:

    DATETIMEOFFSET is a data type
    http://msdn.microsoft.com/en-us/library/bb630289.aspx

    TODATETIMEOFFSET is afunction
    http://msdn.microsoft.com/en-us/library/bb630335.aspx

    DATETIME2 data type doesn’t store offset.
    http://msdn.microsoft.com/en-us/library/bb677335.aspx

    So, if the [WebAnDB].[Visitors]..[Accessed] needs to store offset I would go with changing the type to prior that DATETIMEOFFSET.

    How ever if we are considering changes made by the procedure the TODATETIMEOFFSET would work, unless the [Accessed] data type allows to store the whole information.




    0



    0

Leave a Reply