天天看點

sql中while周遊更新字段資料

while exists(select 1 from xlhhis..emrzy_doclist where docbill is null)

begin

update xlhhis..emrzy_doclist set docbill=[dbo].[fun_emr_docbill]('') where objid=

(select top 1 objid from xlhhis..emrzy_doclist  where docbill is null)

end

轉載于:https://www.cnblogs.com/cwfsoft/archive/2010/07/22/1782697.html