I have the following code to convert records with a column of integer into binary code:
CREATE TYPE T_Table AS table(MyColumn int);
GO
CREATE FUNCTION FUNC_Test(@table T_Table READONLY) RETURNS varbinary AS BEGIN
...
RETURN <anything as varbinary>
END;
GO
SELECT
X.ID
,dbo.FUNC_Test(
(SELECT <anything as int> FROM <any table y> WHERE ID = X.ID)
)
FROM
<any table x> AS X
GROUP BY
X.ID
;
GO
But this doesn't work. Why can't I use a Select statement as a parameter for the user defined function?
Is it possible without CLR?