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
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?
Because you cannot use CREATE TABLE within a function, or create any other DB object. Try it…
Because of INSERT INTO … EXEC I think
which one is the correct answer: A because that is the reference?
The most sensible answer for this is D. I wouldn’t put a batch process in a function…
D