Hiya folks, I'm having an issue with a particular query and it's driving me nuts. I have a stored procedure running a query that looks like this:
INSERT INTO someTable(someFields)
FROM tblRM rm INNER JOIN tblRMDtl rmdtl On rm.rm_id = rmdtl.rm_id
INNER JOIN tblEmployee emp ON emp.employee_id = rmdtl.employee_id
INNER JOIN tblNotificationType nt ON nt.notification_type_id = dbo.GetNotificationtypeID2(rm.rm_time, GETDATE())
QA is throwing errors at me telling me there is a syntax error on the last line around ")". I can take the entire query and run it on it's own with no errors at all. I have a hunch this has something to do with user defined functions not playing nice with stored procedures. however, just for the hell of it, I created a test proc to make sure I could return a value from my udf and was successful.
What am I doing wrong here? Can I simply not use a udf as part of a join in a stored proc?