I need to run the following query. The code runs fine in SQL but I'm not sure what to do with it in Cold Fusion. I am using SQL 7 and CF5. The query (with hardcoded values instead of variables) is:
I suspect this may involve a CFTransaction but am not sure how to implement it. Everything I've done has given me a "...does not specify the name of a valid query" error.
Code:
DECLARE @emps varchar(50)
SELECT @emps = COALESCE(@emps + ';', '') + e.last_name
FROM employee.dbo.employee e
WHERE e.employee_id IN (1991,70665)
SELECT *, @emps AS employees
FROM job_no
WHERE sim_id = 4