IF OBJECT_ID('tempdb..#temp') > 0
DROP TABLE #temp
SELECT * INTO #temp FROM (SELECT * FROM TABLENAME)
SELECT * FROM #temp
SELECT COUNT(*) FROM #temp
DROP TABLE #temp
SELECT * INTO #temp FROM (SELECT * FROM TABLENAME)
SELECT * FROM #temp
SELECT COUNT(*) FROM #temp
No comments:
Post a Comment