Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When I add the WHERE clause mGroup

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
0
0
US
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.
Code:
DECLARE
 @Job int,
 @Group nvarchar(50)
INSERT INTO #TempTable 
(
  ImageName
)
SELECT 
  ImageName
FROM 
  Photos
WHERE
  Hide = 1 AND JobNumber = @Job
AND mGroup = @Group
 
No error. When I execute the SP I pass in an nvarchar value (just a string). Incidentally, I am caling this from ADO.Net.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top