Creating temp tables SQL Server 13.0.5426 with dynamic SQL doesn't work
This has never worked.

If you want to insert into a static temp table dynamically, you can do this:

CREATE TABLE #t(id INT);

DECLARE @sql NVARCHAR(MAX) = N'SELECT 1 FROM sys.databases;';

INSERT #t ( id )
EXEC sys.sp_executesql @sql;

SELECT * FROM #t AS t;


If you need to build a temp table dynamically, see this Q&amp;A: 


Creating temporary table dynamically using condition