正在更新 SQL Table 的诱惑
Updating SQL Table for a temptable
我有一个 SQL table 从临时 table 获取所有数据。我想在临时 table 中添加一列。我如何更新我的 sql table?谢谢
ps:#Sonuc 是我的温度 table 而 ANALIZ.dbo.HizliSatanOptionRaporu2_v1 是永久的。
select hr.STORECODE,
s.StoreDescription,
s.StoreAtt04 AVMCadde,
s.StoreAtt05 SezonOutlet,
s.StoreAtt06 SesGrup,
s.StoreAtt07 Brands,
s.StoreAtt25 MeteorYaz,
s.StoreAtt26 MeteorKis,
s.StoreAtt27 StoreGrade,
s.StoreAtt28 MusteriProfili,
s.CityDescription Sehir,
s.StateDescription Bolge,
Division,
Department,
SubDepartment,
Category,
Class,
ItemCode,
ColorCode,
LEFT(ItemCode,2) Sezon,
ItemCode+ColorCode [Option],
ToplamStok,
ToplamSatis,
case when ToplamSatis=0 then 0 else 1 end SatisVarMi,
SDH,
Att_Basic,
BasicOlmaDurumu,
Sorun,
hr.ProductHierarchyID,
GETDATE() as SonGuncellemeTarihi
into #Sonuc
from #HiyerarsiID hr
join ANALIZ.dbo.tb_ProductHierarchy ph on hr.ProductHierarchyID = ph.ProductHierarchyID
inner join ANALIZ.dbo.gg_StoreInfo s on s.StoreCode=hr.StoreCode
select *
into ANALIZ.dbo.HizliSatanOptionRaporu2_v1
from #Sonuc
就像平常一样table。
改变table #tempTable
添加列 int
我有一个 SQL table 从临时 table 获取所有数据。我想在临时 table 中添加一列。我如何更新我的 sql table?谢谢
ps:#Sonuc 是我的温度 table 而 ANALIZ.dbo.HizliSatanOptionRaporu2_v1 是永久的。
select hr.STORECODE,
s.StoreDescription,
s.StoreAtt04 AVMCadde,
s.StoreAtt05 SezonOutlet,
s.StoreAtt06 SesGrup,
s.StoreAtt07 Brands,
s.StoreAtt25 MeteorYaz,
s.StoreAtt26 MeteorKis,
s.StoreAtt27 StoreGrade,
s.StoreAtt28 MusteriProfili,
s.CityDescription Sehir,
s.StateDescription Bolge,
Division,
Department,
SubDepartment,
Category,
Class,
ItemCode,
ColorCode,
LEFT(ItemCode,2) Sezon,
ItemCode+ColorCode [Option],
ToplamStok,
ToplamSatis,
case when ToplamSatis=0 then 0 else 1 end SatisVarMi,
SDH,
Att_Basic,
BasicOlmaDurumu,
Sorun,
hr.ProductHierarchyID,
GETDATE() as SonGuncellemeTarihi
into #Sonuc
from #HiyerarsiID hr
join ANALIZ.dbo.tb_ProductHierarchy ph on hr.ProductHierarchyID = ph.ProductHierarchyID
inner join ANALIZ.dbo.gg_StoreInfo s on s.StoreCode=hr.StoreCode
select *
into ANALIZ.dbo.HizliSatanOptionRaporu2_v1
from #Sonuc
就像平常一样table。
改变table #tempTable 添加列 int