I have 2 servers, production and UAT. I have the same stored procedure on each of them. SQL is configured the same on both.
When I use openrowset to execute the SP on UAT it works, when I use openrowset to execute the SP on production it fails.
Here is the command I use to execute the SP on each server:
select*from OPENROWSET ('SQLOLEDB','Server=SNAVNSQLQCLO003;TRUSTED_CONNECTION=YES;',
'SET FMTONLY OFF;set nocount on;SET ANSI_WARNINGS OFF; exec Winscape_QCClosing.dbo.monitoringQC_NetIQ_All)
select*from OPENROWSET ('SQLOLEDB','Server=SNAVPSQLQCLO001;TRUSTED_CONNECTION=YES;',
'SET FMTONLY OFF;set nocount on;SET ANSI_WARNINGS OFF; exec Winscape_QCClosing.dbo.monitoringQC_NetIQ_All')
Here is the error message I get back from production:
Msg 7357, Level 16, State 2, Line 1
Cannot process the object "SET FMTONLY OFF;set nocount on;SET ANSI_WARNINGS OFF;SET ANSI_NULLS OFF; exec Winscape_QCClosing.dbo.monitoringQC_NetIQ_All". The OLE DB provider "SQLNCLI10" for linked server "(null)" indicates that either the object has no columns or the current user does not have permissions on that object.