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:
It´s not A ? õ_Ô
0
0
YES ITS A
1
0
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
0
0
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
It’s A
0
0
C
0
0
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
We came across a cool site which you could possibly delight in. Take a appear when you want.
0
0
we came across a cool internet site that you may well get pleasure from. Take a look should you want
0
0
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
0
0
here are some hyperlinks to sites that we link to due to the fact we think they’re really worth visiting
0
0
just beneath, are several completely not related websites to ours, however, they may be certainly worth going over
0
0
very few sites that transpire to become detailed below, from our point of view are undoubtedly properly worth checking out
0
0
usually posts some quite intriguing stuff like this. If youre new to this site
0
0