Hello All,
I have a simple TestFunction UDF
Code:
CREATE FUNCTION dbo.TestFunction ( @Idx int )
RETURNS @TestTabel TABLE ( Idx int, Field1 int, Field2 int )
AS
BEGIN
INSERT @TestTabel ( Idx, Field1, Field2 )
SELECT @Idx, 1, 2
RETURN
END
Inserted in a query
Code:
SELECT TestFunction.Idx, TestFunction.Field1, TestFunction.Field2
FROM dbo.TestFunction(dbo.TempItems.ID) TestFunction INNER JOIN
dbo.TempItems ON TestFunction.Idx = dbo.TempItems.ID
When I want to execute it Ill get the following message
Error in list of function arguments: '.' not recognized.
Incomplete parameters list.
So dbo.TempItems.ID is not axepted as an value but is interpreted as text
If I execute the query with a fixed value then it runs fine.
Code:
SELECT TestFunction.Idx, TestFunction.Field1, TestFunction.Field2
FROM dbo.TestFunction(12) TestFunction INNER JOIN
dbo.TempItems ON TestFunction.Idx = dbo.TempItems.ID
How do I get a table of numbers in it?
Regards,
Marco