This question already has an answer here:
- SQL Server 2008: Can a multi-statement UDF return a UDT? [duplicate] 1 answer
- SQL Server 2008 - How do i return a User-Defined Table Type from a Table-Valued Function? 5 answers
I have my own type:
CREATE TYPE MyType AS TABLE
(
foo INT
)
and a function receiving it as a parameter:
CREATE FUNCTION Test
(
@in MyType READONLY
)
RETURNS @return MyType
AS
...
can it return MyType
or only TABLE
repeating MyType's structure:
CREATE FUNCTION Test
(
@in MyType READONLY
)
RETURNS @return TABLE (foo INT)
AS
...
?