Tip of my tongue...
Date: 01/28/05
(SQL Server) Keywords: no keywords
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))
Source: http://www.livejournal.com/community/sqlserver/17275.html