Thanks 🙂 , but I'm trying to run some dynamic sql which I have built into a memory variable, rather than calling a stored procedure. Something like:
select *
into #tab
from exec (@MyDynamicCode)
which I know is wrong. I may not have rights to use openrowset, and anyway, using OLE DB for dealing with SQL server tables within SQL Server seems somehow inappropriate.