View Single Post
Old 23.06.2007, 20:12   #8
hr
Архивный участник
 
Join Date: Jun 2005
Posts: 285
Default

zomg o_O
1.
Code:
ALTER PROCEDURE [dbo].[char_delete]
-->
Code:
CREATE PROCEDURE [dbo].[char_delete]
2.
Code:
select @a = ...
-->
Code:
set @a=...
3. better use cursor instead of while loop
4. even better not to use any loop/cursor at all:
Code:
WHERE char_id = @limit
-->
Code:
where char_id in (select char_id from user_deleted)
--OR (the same thing actually)--
Code:
where char_id in (select char_id from user_data where account_id=-1)
5.
Code:
warehouse BETWEEN 0 AND 1
-->
Code:
warehouse <> 2
6. remove
Code:
DELETE FROM user_deleted WHERE char_id = @limit
hr is offline