标签:
Declare @id int DECLARE cursor_data CURSOR FOR SELECT GeneralID FROM Article WHERE id > 7146 --这里是取得数据源 OPEN cursor_data FETCH FROM cursor_data INTO @id WHILE @@FETCH_STATUS=0 BEGIN PRINT ‘旧表ID:‘+ CONVERT(NVARCHAR(100),@id) --拿到这个id后 就可以进行其他操作了--添加操作开始 --添加操作完成 FETCH FROM cursor_data INTO @id END CLOSE cursor_data DEALLOCATE cursor_data
标签:
原文地址:http://www.cnblogs.com/maijin/p/4689286.html