DECLARE InvoiceOID_cursor CURSOR FOR
select oid from Invoice
OPEN InvoiceOID_cursor
FETCH NEXT FROM InvoiceOID_cursor INTO @InvoiceOID
WHILE @@FETCH_STATUS = 0
BEGIN
-- PRINT @message
-- delete from XXX where oid = @InvoiceOID
-- Do Something !
FETCH NEXT FROM InvoiceOID_cursor INTO @InvoiceOID
END
CLOSE InvoiceOID_cursor
DEALLOCATE InvoiceOID_cursor
沒有留言:
張貼留言