views:

33

answers:

1

Hello everyone,

I am using SQL Server 2008 (let us call this source database server in this question discussion), and in SSMS, I have created a linked server to another SQL Server 2008 database (let us call this destination database server in this question discussion).

When I issue statement -- select * from [linked server name].[database name].[dbo].[table name], error will be returned,

Linked server "ZS" The OLE DB access interface "SQLNCLI10" returned "NON-CLUSTERED and NOT
INTEGRATED "Index" ix_foo_basic_info_nf ", which is incorrect bookmark ordinal 0.

When I issue statement -- select * from openquery([linked server name],'select * from [table name]'), there will be no errors, any ideas what is wrong?

thanks in advance, George

+1  A: 

Is the Index As Access Path option set for the Linked Server Provider? If so, try removing this and see if it fixes the problem.

starskythehutch
"Index As Access Path"? New to me. :-(How to check and why it causes the issue I desribed but no issues for openquery?
George2
From this link, I find what means Index As Access Path, but can not find how to turn it off.http://msdn.microsoft.com/en-us/library/ms188095.aspx
George2
This option can be found in Server Objects>Linked Servers>Providers and right click>Properties.It sets whether the the query will use the linked servers indexes to try and retrieve data. Not sure about openquery, but I'm guessing it never uses indexes.
starskythehutch
You mean the first form of SQL uses index, and openquery not using index? But why using index will cause issues?
George2
There are many providers listed under Providers, like ADsDSOObject, MSOLAP, SQLNCLI, SQLNCLI10, SQLOLEDB, which one should I remove Index As Access Path properties?
George2
Which ever provider you used when setting up the Linked Server. I think in your case it should be SQLOLEDB.
starskythehutch
From where you see SQLOLEDB? I saw SQLNCLI10. :-)
George2
It depends which one you have set up. Maybe you should look to see what each one is, to find the one you have used.
starskythehutch
Actually I do not setup any provider explicitly. I just write SQL. Any ideas how to find which provider I am using?
George2
If you have a linked server, you are using one of the providers.
starskythehutch
I mean how could I quickly find which one I am using? I think to set every provider to disable "Index As Access Path" seems stupid. :-)
George2
Thanks, question answered!
George2