declare @objectID int; declare objcur cursor for select top 10 object_id from m_object open objcur fetch next from objcur into @objectID while @@fetch_status = 0 begin print 'dev' + cast(@objectID as varchar(32)) fetch next from objcur into @objectID end close objcur deallocate objcur
写的cursor demo仅作记录.....