Groups | Blog | Home
all groups > sql server clients > october 2003 >

sql server clients : SQL 7 query errors from dotnet but works from Query Analyzer


David P.
10/29/2003 2:02:51 PM
We are running a query from a dotnet 1.1 client which is
working fine on SQL 2000 but times out on SQL 7. The
query does work on SQL 7 when using Query Analyzer 2000.
With the dotnet app the connection times out (a trace
shows the query finished). If we use Query Analyzer 7
(sp 4) the following errors are returned:

[MICROSOFT] [ODBC SQL SERVER DRIVER] Protocol error in
TDS stream
[MICROSOFT] [ODBS SQL SERVER DRIVER] Function sequence
error

By simply changing some of the column orders the query
will work but since this is a shrink wrapped app we are
hoping to find a SQL 7 setting that will solve the
Andrew J. Kelly
10/29/2003 6:54:20 PM
It might help to see the actual query and the DDL of the table.

--

Andrew J. Kelly
SQL Server MVP


[quoted text, click to view]

v-yshao NO[at]SPAM online.microsoft.com
10/30/2003 8:01:18 AM
Hi David,

I would like to thank Andrew for his help. I agree with him. The actual
query and the data definition language (DDL) help accelerate the
troubleshoot process.

Based on my research, according to the error message and the version of SQL
Server, there is a known issue on SQL Server 7.0 with retrieving data from
a select statement with left outer joins. The workaround is

I am standing by for your response.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

v-yshao NO[at]SPAM online.microsoft.com
10/30/2003 8:19:25 AM
Hi David,

I would like to thank Andrew for his help. I agree with him. The actual
query and the data definition language (DDL) help accelerate the
troubleshoot process.

Based on my research, according to the error message and the version of SQL
Server, there is a known issue on SQL Server 7.0 with retrieving data from
a select statement with left outer joins.

I am standing by for your response.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
v-yshao NO[at]SPAM online.microsoft.com
10/31/2003 10:11:54 AM
Hello David,

Thanks for your mail. I received the files sucessfully. I would appreciate
your patience while I am performing reproduce on this isuse. I will post my
response at soon as I have update for you.

Thanks for posting to MSDN Managed Newsgroup.

Thank you,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

v-yshao NO[at]SPAM online.microsoft.com
10/31/2003 5:35:42 PM
Hi David,

Because of the detailed reproduce stuff and information, I reproduced this
problem on my side successfully. I saw the error messages. Based on my
further research, I think this is the known issue with SQL Server 7.0,
sometimes occurring with SQL Server 2000.

When running a select statement with left joining many tables and views and
returning many columns, the output TDS stream may be corrupted and the
following error will be generated:

[Microsoft][ODBC SQL Server Driver]Protocol error in TDS stream
[Microsoft][ODBC SQL Server Driver]Function sequence error

Because the occurrence of the problem depends on the SQL statements, there
is not a recommended universal workaround. Thanks for your understanding.
It always can be fixed via doing some changes with the columns.

Thanks for using MSDN newsgroup.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
David P.
11/3/2003 9:13:45 AM
thanks for your help Michael,

Since there is no reliable work around we will have to
test more thoroughly with SQL 7. This is difficult
because we have so much dynamic SQL being generated.

I am disappointed that Query Analyzer 2000 can handle the
corrupted TDS stream but that ADO.net cannot. Is there
any possible solution there?


v-yshao NO[at]SPAM online.microsoft.com
11/4/2003 1:10:24 PM
Hi David,

Thanks for your feedback. I think this article should help you a lot.
315938 FIX: SELECT That References Several Tables May Return Invalid TDS
Error
http://support.microsoft.com/?id=315938

In the above article, it seems that this problem has been correct by SQL
Server 7 SP4. I would like you to check the version and service pack of
your SQL Sever.
321185 HOW TO: Identify Your SQL Server Service Pack Version and Edition
http://support.microsoft.com/?id=321185

Does the version of SQL Server is SQL Server 7.0 SP4? Are you sure that
this problem also occur with SQL Server 7.0 SP4 (not MSDE)? If so, it is
better to upgrade the instance to SQL Server 2000.

Thanks for using MSDN newsgroup.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
David P.
11/7/2003 2:31:19 PM
Michael,

I'm familiar with both ariticles and yes we are having
problems with SQL 7 with sp 4.

One of our customers has upgraded to SQL 2000 and the
problem has disappeared.

I am still curious as to why Query Analyzer 2000 can
handle a 'corrupted' TDS stream (from SQL Server 7) that
neither ADO.net nor Query Analyzer 7 can handle.



v-yshao NO[at]SPAM online.microsoft.com
11/10/2003 1:02:34 PM
Hi David,

Thanks for your feedback. In this case, it seems that the problem
disappeared when the instance upgraded to SQL Server 2000 on your side.
Based on my research, this is a known issue with SQL Server 7.0. This is
weird that the problem also occurred with SQL Server 7.0 sp4. If you would,
can you apply the service pack4 again on the problematic SQL Server
instance?
301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack
http://support.microsoft.com/?id=301511

If the problem still occurs on SQL Server 7.0 sp4 and you insist on looking
for the answer for your curiousness, due to the complexity of this issue,
it would be best to contact Microsoft Product Support Services via
telephone so that a dedicated Support Professional can assist with your
request. To obtain the phone numbers for specific technology request please
take a look at the web site listed below.
http://support.microsoft.com/default.aspx?scid=fh;EN-US;PHONENUMBERS

Please let me know if you need further assistance.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
AddThis Social Bookmark Button