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

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

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

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:



Leave a Reply 14

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


Makira

Makira

It´s not A ? õ_Ô

Faisal

Faisal

C is incorrect. See the link below
http://stackoverflow.com/questions/2877247/using-a-table-value-function-inside-a-view-in-sql-server
Here is the code to try from above link:
CREATE FUNCTION dbo.GetScheduleForEmployee()
RETURNS TABLE
AS
RETURN
(
SELECT 1 AS id
UNION ALL
SELECT 2
)
GO

CREATE VIEW myview
AS
SELECT *
FROM GetScheduleForEmployee() AS schedule

GO

SELECT *
FROM myview

Shaun

Shaun

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.

ashok

ashok

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

Google

Google

We came across a cool site which you could possibly delight in. Take a appear when you want.

si potrebbe provare qui

si potrebbe provare qui

we came across a cool internet site that you may well get pleasure from. Take a look should you want

sprint

sprint

that will be the end of this article. Here you will discover some web pages that we think you will value, just click the hyperlinks over

Free online games

Free online games

here are some hyperlinks to sites that we link to due to the fact we think they’re really worth visiting

Outdoor wood fired pizza oven mobile Pizza Party made in Italy

Outdoor wood fired pizza oven mobile Pizza Party made in Italy

just beneath, are several completely not related websites to ours, however, they may be certainly worth going over

Cash for car melbourne

Cash for car melbourne

very few sites that transpire to become detailed below, from our point of view are undoubtedly properly worth checking out

Fenster

Fenster

usually posts some quite intriguing stuff like this. If youre new to this site