Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I can use the Management studio to connect directly to my Azure SQL database and execute this query:

select * from DB.dbo.DSeries where instrument='name1' 

and it works really fast. But if I create a linked server (called "WF") in my local server that connects to Azure and try to execute the same query,

select * from WF.DB.dbo.DSeries where instrument='name1' 

The query is really slow. Why could that be happening?

share|improve this question
4  
However, SELECT * FROM OPENQUERY(WF, 'select * from DB.dbo.DSeries where instrument=''name1'' ') seems to work fast !? –  Nestor Nov 21 '11 at 6:47

1 Answer 1

up vote 5 down vote accepted

Try setting the "Collation Compatible" to True on the Linked Server definition.

If you set it to False, it will pull the entire table down and do the compare on the receiving end. Consider the scenario where the local server is case insensitive, and the remote server is case sensitive, the results will differ based on where the compare is done.

share|improve this answer
3  
Yessss... that solved it. Care to explain the solution? –  Nestor Nov 21 '11 at 18:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.