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 function to return the type:
CREATE FUNCTION [dbo].[GetFoos]
RETURN @FooTypes TABLE ([Bar] [INT])
INSERT INTO @FooTypes (1)
RETURN
Basically, im having to re-declare my type definition in the RETURN statement of the function. Isnt there a way i can simply declare the type in the RETURN statement?
I would have thought this would work:
CREATE FUNCTION [dbo].[GetFoos]
RETURN @FooTypes [FooType]
INSERT INTO @FooTypes (1)
RETURN
Cannot find any help on MSDN/Google regarding this....anyone?