use @@rowcount and not count
if @@rowcount >0 ....
taker into consideration:
data type of the colunms.
size of tables
indexes, indexes and indexes
use nvarchar(max) in sql 2005 and higher, so u'll be able to keep all string functionality
i found out the that my tempdb become huge. trying to shrik it did not help.
i looked in sysobejcts of temp db and found old temporary tables created...
try to avoid as much as possible the use of funtion in field in the where cause, it causes full table scan!
delete the data with chunck let say 10k records
set @@rowcount =10000
declare @i int
set @i= 0
while exists(select 1 from Delete webproxylog...
try running sp_recompile on all stored procedures.
Separate names with a comma.