SELECT *
FROM OPENROWSET('SQLNCLI','Server=(LOCAL);Trusted_Connection=Yes;Database=DB_Name','EXEC [DB_Name].dbo.SP_Name')
and you got the following error:
Cannot process the object
"EXEC [DB_Name].dbo.SP_Name". 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.
to solve this, just add SET FMTONLY OFF as the following:
SELECT *
FROM OPENROWSET('SQLNCLI','Server=(LOCAL);Trusted_Connection=Yes;Database=DB_Name','SET FMTONLY OFF
EXEC [DB_Name].dbo.SP_Name')
EXEC [DB_Name].dbo.SP_Name')
After adding 'SET FMTONLY OFF' also I am getting same error
ReplyDeleteSame error with this in 2012.
ReplyDeleteYou are a genius! I had to remove the 'Server=(LOCAL);' part but works for me...
ReplyDeleteI also still get the same error (on SQL 2008 R2 SP2)
ReplyDeletewith or without 'SET FMTONLY OFF' and/or 'Server=(LOCAL);'