我有一个SQL表,可以从temptable中获取所有数据。我想在临时表中添加一列。我怎样才能更新我的sql表?感谢。
ps:#Sonuc是我的临时表,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
答案 0 :(得分:1)
就像普通的桌子一样。
alter table #tempTable 添加列int