When I add the WHERE clause mGroup = @Group my query breaks, but when I drop that part (the part in red) it works. Any ideas why?
The mGroup field is a nvarchar(50) field.
AND mGroup = @Group
The mGroup field is a nvarchar(50) field.
Code:
DECLARE
@Job int,
@Group nvarchar(50)
INSERT INTO #TempTable
(
ImageName
)
SELECT
ImageName
FROM
Photos
WHERE
Hide = 1 AND JobNumber = @Job