Could you point a way to save a select result in a new table by using MSSQLServer?
Hi Experts
Could you point a way to save a select result in a new table by using MSSQLServer?
Accordingly to:
My attempts (no success)
Select * Into MC1_CityZipCodeExt_LAB_NOVO -- new table to receive the resultsFROMSELECT y.lIdState as lIdState, -- lIdState LOC_NU, -- cIdCity LOC_NO, -- cNameCity UFE_SG, -- cCodeState CEP, -- cZiCode 1 as mc1Enabled, -- mc1Enabled CURRENT_TIMESTAMP as mc1LastUpdate, --mc1LastUpdate 'novo' as condicaoFROM LOG_LOCALIDADE_OK tLEFT JOIN MC1_StateZipCodeExt y ON t.UFE_SG = y.cStateWHERE NOT EXISTS (SELECT NULL FROM MC1_CityZipCodeExt x WHERE x.cIdCity = t.LOC_NU AND x.cCodeState = t.UFE_SG AND x.cZiCode = t.CEP )AND t.CEP IS NOT NULL
SELECT y.lIdState as lIdState, -- lIdState LOC_NU, -- cIdCity LOC_NO, -- cNameCity UFE_SG, -- cCodeState CEP, -- cZiCode 1 as mc1Enabled, -- mc1Enabled CURRENT_TIMESTAMP as mc1LastUpdate, --mc1LastUpdate 'novo' as condicaoFROM LOG_LOCALIDADE_OK tLEFT JOIN MC1_StateZipCodeExt y ON t.UFE_SG = y.cStateWHERE NOT EXISTS (SELECT NULL FROM MC1_CityZipCodeExt x WHERE x.cIdCity = t.LOC_NU AND x.cCodeState = t.UFE_SG AND x.cZiCode = t.CEP )AND t.CEP IS NOT NULLInto MC1_CityZipCodeExt_LAB_NOVO