Home Forums SQL Server 7,2000 T-SQL Error 266 after executing SP RE: Error 266 after executing SP
Rajesh Patavardhan
SSCrazy
Points: 2801
More actions
April 25, 2003 at 12:53 am
#455331
Note that COMMIT statement will not execute if there is no data in @TableToBeCleaned satisfying the where clause.
Change the fourth line as
SET @STR = @STR + 'COMMIT ' + 'IF @@ROWCOUNT = 0 ' + 'BREAK ' + 'END ' + 'SET ROWCOUNT 0'