INSERT EXEC cannot be nested

Error: An INSERT EXEC statement cannot be nested

solution: rewrite as an openquery

select * from OPENQUERY([LOCALSERVERNAME],’EXEC dbase.schema.proc’)

Error: SQL Server not configured for data access

solution: enable data access

EXEC sp_serveroption ‘LOCALSERVERNAME’, ‘DATA ACCESS’, TRUE

Error: The OLE DB provider “SQLNCLI10” for linked server “LOCALSERVERNAME” indicates that either the object has no columns or the current user does not have permissions on that object.

solution: Add SET FMTONLY OFF;SET NOCOUNT ON

select * from OPENQUERY([LOCALSERVERNAME],’SET FMTONLY OFF;SET NOCOUNT ON;EXEC dbase.schema.proc’)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: