I am running a stored procedure that deletes data from a table, the procedure looks like:
SET rowcount 10000
WHILE ( @rows_deleted > 0 )
BEGIN
BEGIN TRAN
DELETE TABLE1 WHERE status = '1'
SELECT @rows_deleted = @@rowcount
COMMIT TRAN
END
While this procedure is running, update statistics is also running on the same table. The table's lock scheme is all pages. I am wondering if the locking is all pages how can it encounter a deadlock? There is nothing else running on this table.
I am using Sybase 12.5 ASE