IF OBJECT_ID('tempdb..#abc') IS NOT NULL DROP TABLE #abc GO select * into #abc from District where DistrictId=1 select * from #abc