I am trying to execute a SQL-Statement
SELECT *
FROM Menu
WHERE ISNumeric(Data) = 1
AND Data = 296
where the Data field may contain numeric or non-numeric contents.
But I am getting syntax error something like
Syntax error on converting the varchar-value ‘/home’ in a column of Data type int.
since
DATAcolumn is varchar, you need to enclosed the value (296) with single quoteyou can still directly query without using
ISNUMERIChere, and increases performance since you don;t have to check every record for numeric values.Using
IsNumericis pointless, I guess, in your situation.