私はユーザー定義フィールドのテーブルを持っています。私は別のテーブルに基づいて更新したがっています。私は次のクエリを作成しました。
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を使用する必要があります –