delete

Declare @I int

Set @I=0

While 1=1

BEGIN

    if exists (Select top 1 * from SF_M1_CheckOK

       where TransDateTime < '20080101000000')

    BEGIN

       Delete top (100) from SF_M1_CheckOK

       where TransDateTime < '20080101000000'

       Set @I=@I+1

       print Convert(varchar,@I)

    END

    ELSe

    BEGIN

       Break

    END

END

 

posted on 2009-07-04 00:20    阅读(190)  评论(0编辑  收藏  举报