Which object should you use?

You develop a Microsoft SQL Server 2012 database. You need to create a batch process that meets the
following requirements:
Status information must be logged to a status table.
If the status table does not exist at the beginningof the batch, it must be created.
Which object should you use?

You develop a Microsoft SQL Server 2012 database. You need to create a batch process that meets the
following requirements:
Status information must be logged to a status table.
If the status table does not exist at the beginningof the batch, it must be created.
Which object should you use?

A.
Scalar user-defined function

B.
Inline user-defined function

C.
Table-valued user-defined function

D.
Stored procedure

Explanation:
Verified answer as correct.
Reference: http://msdn.microsoft.com/en-us/library/ms186755.aspx



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Martin

Martin

The answer is D but the Explanation is a link to Functions. Can someone explain to me why D.stored procedure is the correct answer?

Riken

Riken

Because you cannot use CREATE TABLE within a function, or create any other DB object. Try it…

Michael

Michael

Because of INSERT INTO … EXEC I think

nikola

nikola

which one is the correct answer: A because that is the reference?

Stone Cold

Stone Cold

The most sensible answer for this is D. I wouldn’t put a batch process in a function…