Link to home
Start Free TrialLog in
Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Conversion failed when converting the varchar value 'default.asp?ID =' to data type int.

Help!!

I'm getting the following error --

Conversion failed when converting the varchar value 'default.asp?ID =' to data type int.

my code is --

select
CASE WHEN P.Title <> '' THEN P.Title ELSE N.Title END as Title,
CASE WHEN P.ID <> '' THEN 'default.asp?ID ='+P.ID+'&amp='+P.SEOLink ELSE N.AlternativeURL END as URL
from [dbo].[MYNavigation] N
LEFT Join dbo.MyPage P
on N.PageID = P.ID
Where N.Live = 'Y'
Order By NavOrder

Open in new window


Thank you
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

I just wanted to jump in and say you should be using parameterized queries. Unless you're doing some sort of manual examination, your SQL there is ripe for exploitation.  You will be hacked - it's just a matter of time.
ASKER CERTIFIED SOLUTION
Avatar of DustinKikuchi
DustinKikuchi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of garethtnash

ASKER

Thank you