简单游标

declare @addressid int
declare authors_cursor cursor for
SELECT address.addressid FROM address

open authors_cursor
fetch next from authors_cursor into @addressid

while @@fetch_status=0
begin

--T-SQL 


fetch next from authors_cursor into @addressid
end

close authors_cursor
Deallocate authors_cursor

posted @ 2009-11-16 11:07  jmz  阅读(124)  评论(0编辑  收藏  举报
Copyright by © Pippon