Binding information is invalid
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.
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
DBA BlogUseful things about managing SQL Server. Scripts, errors, tips and other thinks that worth sharing.