Image

Imagesqlnerd wrote in Imagesqlserver

Tip of my tongue...

There must be a way to get this to work without more than 1 line of code..

UPDATE bannedIPs set offenseCount = offenseCount + convert(int,('select count(*) as offenseCount from iislog where ipaddr = ' + ipaddr))

I tried exec 'select..... not expecting it to work and of course it didn't.. any ideas?

Got it :) FYIL: UPDATE bannedIPs set offenseCount = offenseCount + convert(int,(select count(*) as offenseCount from iislog where ipaddr = bannedIPs.ipaddr))