declare @tableA as table( item_name varchar(50), item_cname nvarchar(50) ) insert @tableA (item_name, item_cname) select b.item_name, a.item_cname from [Tg_ExcelImport] a, Tg_ExcelImport b where a.table_name = ‘tg_staffinfo‘ and b.table_name = ‘tg_staffinfo_temp‘ and a.item_name = b.item_name update [Tg_ExcelImport] set item_cname = (select item_cname from @tableA a where a.item_name = Tg_ExcelImport.item_name and Tg_ExcelImport.table_name = ‘tg_staffinfo_temp‘)
时间: 2024-11-02 22:14:37