PrepAway - Latest Free Exam Questions & Answers

Which of the following statements regarding SQL Server 2012 objects is TRUE?

Which of the following statements regarding SQL Server 2012 objects is TRUE?

PrepAway - Latest Free Exam Questions & Answers

A.
A user-defined data type can accept an input variable and return a table of results but cannot
be used within a view.

B.
A scalar function can accept an input variable and return a table of results but cannot be used
within a view.

C.
A table-valued function can accept an input variable and return a table of results but cannot be
used within a view.

D.
A table-valued type can accept an input variable and return a table of results but cannot be
used within a view.

Explanation:

22 Comments on “Which of the following statements regarding SQL Server 2012 objects is TRUE?

    1. Shaun says:

      C. A table-valued function can accept an input variable and return a table of results but cannot be used within a view.

      Something wrong with the answers as it says the result cannot be used within a view.
      You code demonstrate it can be used within a view.




      1



      0
  1. ashok says:

    It is option A only
    because you cant able to create user defined datatype inside views

    you will get following error message

    Msg 156, Level 15, State 1, Procedure ViewwithVariables, Line 4
    Incorrect syntax near the keyword ‘declare’.

    CREATE view ViewwithVariables
    as

    Declare @Cid int

    set @Cid=154

    SELECT * from
    dbo.Partners P
    join dbo.Events E on P.CompanyID=E.CompanyID
    WHERE E.CompanyID=@cid




    0



    0

Leave a Reply