Problem

When trying to select data from a view through a linked server the following error can appear:

SELECT *  FROM [SERVER_NAME].DATABASE_NAME.DBO.VIEW_NAME


OLE DB provider "SQLNCLI" for linked server "SERVER_NAME" returned message "Binding information is invalid.".

Msg 7346, Level 16, State 2, Line 1

Cannot get the data of the row from the OLE DB provider "SQLNCLI" for linked server " SERVER_NAME".

 

Tested with other views / tables, the linked server turns out to work fine so the problem is in particular with that view.

 

Solution

As a workaround you can select data from that view using OPENQUERY, and it works. 

SELECT * FROM OPENQUERY([SERVER_NAME], 'SELECT *  FROM DATABASE_NAME.DBO.VIEW_NAME')

 

The problem seems to be related to this particular view definition (wrong data type used, etc).

After recreating the view the select through linked server worked fine.

 


No feedback yet

Leave a comment


Your email address will not be revealed on this site.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)