摘要:
用游标来实现:declare @temp varchar(20),@i int,@utemp varchar(20)set @temp='172.22.8.'set @i=1DECLARE abc CURSOR FOR SELECT username FROM test ;OPEN abcFETCH next from abc into @utempWHILE @@FETCH_STATUS = 0 BEGIN UPDATE dbo.test SET ip = @temp+cast(@i as varchar(20)) FROM dbo.test WHERE CURRENT OF 阅读全文
posted @ 2008-12-11 21:14 codingsilence 阅读(157) 评论(0) 推荐(0) 编辑