I am running into a \n issue and it seems like none of the solutions I found online helped me to fix it.
So basically I want to have the result of a stored procedure into a temp table. I cannot use functions as it gets complex. so My first solution didn't work as I have a temp table inside this sproc:
create table #CodeSecCode
, SecCode float
, StartDate datetime
, EndDate datetime
Insert into #CodeSecCode
I get an error here An INSERT EXEC statement cannot be nested.
Now, some of you would recommend a table variable but the temp table could be big and I may run in performance issue so prefer to keep the temp table. I tried the second approach :
'EXEC [dbo].[spGetCodeSecCode] AS a
and this again fails with an error
The metadata could not be determined because statement.
I see there are different post talking about it but still do not see a solution. has anyone seen this issue before? Any help would be appreciated.
I am using
Microsoft SQL Server 2016 (SP2-CU4) (KB4464106) - 13.0.5233.0 (X64) Nov 3 2018 00:01:54 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor)