Home All Groups Group Topic Archive Search About

SQL server returns error in query analyzer

Author
1 Sep 2006 6:58 PM
News
I run SQL Server 2000 on shared server.
When I work from my office location then everyting is ok, every query
completes fine.
Today, I stayed home, opened query analyzer and types simple query

select * from Mytable where myid = 5034

This worked fine.
Next, I added order by

select * from Mytable where myid = 5034 order by myprimarykeyid

I got this error message
[Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream
[Microsoft][ODBC SQL Server Driver]Function sequence error


Next, I changed order by to some other field

select * from Mytable where myid = 5034 order by myforeignkeyid

This worked fine. Anyways, every time I try to run this query with order by
on primary key field, I get
[Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream
[Microsoft][ODBC SQL Server Driver]Function sequence error


Any idea?

Thank you in advance,

Gene

Author
1 Sep 2006 10:56 PM
Erland Sommarskog
News (zoom191***@yahoo.com) writes:
Show quote
> I run SQL Server 2000 on shared server.
> When I work from my office location then everyting is ok, every query
> completes fine.
> Today, I stayed home, opened query analyzer and types simple query
>
> select * from Mytable where myid = 5034
>
> This worked fine.
> Next, I added order by
>
> select * from Mytable where myid = 5034 order by myprimarykeyid
>
> I got this error message
> [Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream
> [Microsoft][ODBC SQL Server Driver]Function sequence error
>
>
> Next, I changed order by to some other field
>
> select * from Mytable where myid = 5034 order by myforeignkeyid
>
> This worked fine. Anyways, every time I try to run this query with order
> by on primary key field, I get
> [Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream
> [Microsoft][ODBC SQL Server Driver]Function sequence error
>
>
> Any idea?

Could be network problems.

TDS is the protocol that SQL Server talks with its clients. I've run
into TDS errors when connecting to some of our customer's servers,
typically when our connection to their sites have not been top notch.
Packets gets lost along the way, and things can get confused.

What's peculiar in your case is that it's so deterministic and depends
which column you ORDER BY. Hm, have you checked which version of
Query Analyzer you have at home? Maybe you need a service pack for
QA for the MDAC?


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button