SQL Server - SET NO_BROWSETABLE ON ?

Asked By raymond_b_jimene on 29-Aug-07 10:19 AM
I've noticed in my .NET application (with ADO) that whenever a query
is done to SQL Server, a query executing
SET NO_BROWSETABLE ON
is done before.
This has an huge impact on performance, as the round-trip to the
server takes the same time as the correct query. I believe that if
double and network traffic would be reduced.
I've tried to find a reasonable answer on the net for this, but
haven't managed. Has someone noticed this and knows how to correct it?

rj




Bob Barrows [MVP] replied on 29-Aug-07 10:49 AM
Classic ADO? I.E., with ADODB?
or ADO.Net?

I was going to paste in my standard "dotnet" reply, but I just noticed
that you crossposted to some dotnet groups. You need to be aware that
classic (non-dotnet) ado and ado.net are two very different things. This
question is off-topic in one of the ado groups you included in your
crosspost. It is also off-topic in the sqlserver.server group. Since I
am posting via msnews, this reply will not likely make it to the comp
group. When you follow up to this, please remove the off-topic groups
from your post.



I've never noticed this, but i am sure the technique used to execute
your queries might have something to do with it. Be sure to post a small
repro script to whichever group you follow up with

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] replied on 29-Aug-07 11:02 AM
This may help:
http://www.vsj.co.uk/dotnet/display.asp?id=249
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Erland Sommarskog replied on 30-Aug-07 10:13 PM
(raymond_b_jimenez@yahoo.com) writes:

Which .Net Data provider do you use?

ADO (the one is not worthy to be called Classic, but which is not .Net)
spits this out, and it is about impossible to stop.

SqlClient does not send this by default, if you use CommandBehaviour.KeyInfo
it does.


--
Erland Sommarskog, SQL Server MVP, esquel@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
raymond_b_jimene replied on 30-Aug-07 09:47 AM
Actually, I use ADO.Net. Don't recall using KeyInfo anywhere.
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B178366
gives some good information, but the interesting part is:
Data Service (RDS) ActiveX Data Connector (ADC) connections to SQL
Server. Enabling this option..."
Where would the option be? I've looked for it, but no luck.
Has anyone managed to get rid of these "undocumented options"? And
measured the results, as it seem's quite promising?

rj
M replied on 30-Aug-07 10:04 AM
Have you followed the link Bob posted?
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.sqlserver.programming&mid=28c5b926-2bbf-4051-87b4-1f1716367f4a


ML

---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com/
Stephen Howe replied on 30-Aug-07 02:49 PM
Well it may be able to do it but the problem is there is little in the way
of documentation about what ADO does under the hood and what choices affect
what SQL code that gets executed.
It could be that some dynamic proerty changes this.
Over the years, MS documentation has improved on ADO. It is still not good
enough.

Stephen Howe
Erland Sommarskog replied on 30-Aug-07 10:15 PM
(raymond_b_jimenez@yahoo.com) writes:

Which data provider do you use? SqlClient, OleDb or Odbc?


That article was written for 6.5 and a very early version of ADO, so there
is not much guidance there.


--
Erland Sommarskog, SQL Server MVP, esquel@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
raymond_b_jimene replied on 31-Aug-07 12:58 PM
BTDT.
What wonders me is why this has a huge impact on networked servers and
no one seems to have noticed it before. There are some posts before on
the net, but no one seems to know the answer.

rj
M replied on 31-Aug-07 06:26 PM
Does it happen with typed data sets?


ML

---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com/
raymond_b_jimene replied on 14-Sep-07 10:29 AM
For all the docs I've seen till now, KeyInfo really seems like the
most interesting option. A couple of remarks:
1-I use an ExecuteReader with no parameters, so no CommandBehavior is
being used.
2-I do not see any "SET FMTONLY OFF" being executed, despite some
people complaining about that on the net. If one sees
http://msdn2.microsoft.com/en-us/library/system.data.commandbehavior.aspx
it would also be appearing in my case.

I'm now looking into the SqlCommand and SQLConnection classes to see
if something can make the "SET NO_BROWSETABLE ON" disappear. Anyone
got a clue?

rj
Erland Sommarskog replied on 15-Sep-07 08:30 PM
(raymond_b_jimenez@yahoo.com) writes:

Since I don't see SET NO_BROWSETTABLE ON in my test setup, it's a bit
difficult to advice. Maybe you can post a sample program which produces
the dreaded NO_BROWSETABLE? Preferrably this should be a simple
command-line program without GUI.


--
Erland Sommarskog, SQL Server MVP, esquel@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
raymond_b_jimene replied on 24-Sep-07 11:21 AM
There is some hope... I've put my code in a new test environment, and
it does not issue "SET NO_BROWSETABLE ON". I've debugged the situation
further, and found some interesting differences doing some networking
debugging (using Wireshark):

-When I connect in the production environment, the one that gets "SET
NO_BROWSETABLE ON", the "App Name" is set to "Microsoft (R) .Net
Framework" and "Library Name" is set to OLEDB
-When I connect in the testing environment, both "App Name" and

The "App Name" that appears in Wireshark is the same that appears in
SQL Profiler.

An adapted code example follows:
-----------------------------------------
Dim SQLConx As SqlConnection = New SqlConnection
Dim SQLCom As SqlCommand = New SqlCommand
Dim SQLDR As SqlDataReader

Try
SQLCom.Connection = SQLConx
SQLCom.CommandType = System.Data.CommandType.StoredProcedure
SQLCom.CommandText = "myStoredProcedure"
SQLCom.Parameters.Add("@param", _param)
SQLConx.ConnectionString = SQLConnectionString
SQLConx.Open()
SQLDR = SQLCom.ExecuteReader()
SQLConx.Close()
Catch exc As Exception
-----------------------------------------

What's stranger is the OLEDB reference. I'm not using it in my code,
but it appears in the network trace. What might I be missing?

rj
Erland Sommarskog replied on 27-Sep-07 02:11 AM
(raymond_b_jimenez@yahoo.com) writes:

Apparently you are using OleDbConnection etc in production. With OleDb
Client you may experience NO_BROWSETABLE more often.




--
Erland Sommarskog, SQL Server MVP, esquel@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