I'm trying to search my table for a url, and if it in the table, increment the number of hits of the url. Here's my code:tblLinks-----------------------URL | NumOfHits-----------------------ALTER PROCEDURE sproc_UpdateLink ( @url varchar ) AS IF EXISTS(SELECT LinkURL FROM tblLinks WHERE @url = LinkURL) BEGIN UPDATE tblLinks SET NumOfHits = NumOfHits + 1 WHERE @url = LinkURL ENDRETURN
I've also tried:ALTER PROCEDURE sproc_UpdateLink ( @url varchar ) AS IF (SELECT LinkURL FROM tblLinks WHERE @url = LinkURL) IS NOT NULL BEGIN UPDATE tblLinks SET NumOfHits = NumOfHits + 1 WHERE @url = LinkURL ENDRETURN
but that didn't work either.