나는 다른 테이블을 기반으로 업데이트 된 유지하려는 사용자 정의 필드가있는 테이블이 있습니다. 쿼리 내가 실행하려는 업데이트 문을 구축하고 말할 수 수행하기 위해 나는 다음과 같은 쿼리를
select
a + b + c + d + e + f + g + h
from
(select
'update gl00100 set USERDEF1 =' as a,
'''' + DMA + '''' as b,
', set USERDEF2 =' as c,
'''' + Brand + '''' as d,
', set USRDEFS1 =' as e,
'''' + convert(char(10), dateopened, 120) + '''' as f,
'where actnumbr_2 =' as g,
GPStore as h
from
[192.168.xxx.xx].bi.dbo.store
where
store <> 0000 and DateOpened is not null) x
를 만들었습니다. 어떻게 쿼리를 실행 한 다음 결과를 실행할 수 있습니까? 그게 가능한가?
동적 인 SQL –