文件名称:从数据库中批量提取数据
文件大小:20KB
文件格式:SQL
更新时间:2013-11-11 10:38:22
select ,update,where ,declare
Declare XM_Cursor CURSOR FOR SELECT XM,ID FROM JCXX WHERE XM LIKE '%(%' OPEN XM_Cursor FETCH FROM XM_Cursor into @XM,@ID WHILE @@FETCH_STATUS=0 BEGIN set @COUNT = PATINDEX( '%(%', @XM) IF @COUNT > 0 BEGIN SET @YXM = SUBSTRING(@XM,0,@COUNT) UPDATE JCXX SET XM = @YXM WHERE ID = @ID PRINT @YXM END FETCH NEXT FROM XM_Cursor into @XM,@ID END close XM_Cursor DEALLOCATE XM_Cursor