https://stackoverflow.com/questions/1589214/t-sql-looping-through-an-array-of-known-values declare @ ids table ( idx int identity ( 1 , 1 ), id int ) insert into @ ids ( id ) select 4 union select 7 union select 12 union select 22 union select 19 declare @ i int declare @ cnt int select @ i = min ( idx ) - 1 , @ cnt = max ( idx ) from @ ids while @ i < @ cnt begin select @ i = @ i + 1 declare @ id = select id from @ ids where idx = @ i exec p_MyInnerProcedure @ id end
alexnetster@gmail.com/ 나중에 재사용시 흔적을 남겨 찾기 쉽게 하는 것이 목적/ 최대한 간단하게.