I am trying to put the result of Stored Procedure execution into Temp Table:
OPENROWSET('SQLNCLI','Server=(local)\SQL2014;Trusted_Connection=yes;','EXEC myDB.dbo.sp_write_Data @Start_Date=N2020-01-01, @End_Date=N2020-01-22')
select * from #tmpTable
I received the following errors:
OLE DB provider "SQLNCLI11" for linked server "(null)" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "(null)" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg -1, Level 16, State 1, Line 0
SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
It means I am doing something wrong. I replaced (local) by actual Server Name and got the same errors. Please tell me what am I doing wrong? Thank you