I have a custom table type calls UniqueIdentifierTable
CREATE TYPE [dbo].[UniqueidentifierTable] AS TABLE(
[Value] [UNIQUEIDENTIFIER] NULL
)
I have a function that take in this table type as an input:
CREATE FUNCTION [dbo].[MyFunction](@Input UniqueidentifierTable READONLY)
RETURN @Output .....
I attempt to call this from my .NET layer by passing in a default or empty value.
.FromSql("SELECT Output FROM MyFunction(NULL)")
The above calls gives me error
'Operand type clash: NULL is incompatible with UniqueidentifierTable'
Upon googling around, some post suggested that leave it empty then it is a default value so I tried to call the function without any input
.FromSql("SELECT Output FROM MyFunction()")
I would get the error
An insufficient number of arguments were supplied for the procedure or function MyFunction.'
How can I pass in a default empty table value type to this SQL function?