如何使用sql語句做一個循環呢
看代碼
execute update_company_intergrity 1
declare @id int
declare @count int
set @id=1
SELECT @count = max(ID) FROM manager_companydetails
WHILE @id <= @count
BEGIN
execute update_company_intergrity @id
SET @id = @id +1
END
;