SQL Server 2008 - How do i return a User-Defined Table Type from a Table-Valued Function?

后端 未结 4 1216
星月不相逢
星月不相逢 2020-11-29 10:14

Here\'s my user-defined table type...

CREATE TYPE [dbo].[FooType] AS TABLE(
 [Bar] [INT],
)

This is what ive had to do in my table-valued f

4条回答
  •  孤城傲影
    2020-11-29 10:45

    I do not believe this is possible. You cannot use a UDTT as the return type of a Scalar-Valued Function because it is not a scalar value. You also cannot replace the table declaration of a Table-Valued Function with a UDTT. Repeating the table definition seems to be the only option. If we knew why you were doing this, perhaps we could find an alternative.

提交回复
热议问题