You can do this simply without the DECLARE command – which is not valid for #temp tables anyway, only @table variables. Did you try just the following without trying to define #tmp first:
SELECT * INTO #tmp FROM myTable;
You can do this simply without the DECLARE command – which is not valid for #temp tables anyway, only @table variables. Did you try just the following without trying to define #tmp first:
SELECT * INTO #tmp FROM myTable;