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

« sp_cursoropen behavior || This is rather odd... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home