if object_id('tempdb..#temp_table') is not null
Begin
drop table #temp_table
End
SELECT * INTO #temp_table FROM AAA
UPDATE #temp_table set CorporationKeyId=NULL, CityKeyId=NULL
alter table #temp_table drop column Id;
INSERT into AAA SELECT * from #temp_table