0

I have a slow query that I'm trying to analyze. MSDN says I can use

SET SHOWPLAN_TEXT ON

to get SQL Server to return the execution plan information for my query in text. However, whenever I try to SET SHOWPLAN and then execute my query, I get the message "the TDS protocol stream is not valid". I do not get this message if I simply select and execute my query.

Any idea why this is happening, and what I can do about it?

Note: I'm running this from SQLExplorer using JDBC, not FROM SQL Studio. Should that make a difference? TIA, Greg

Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
  • How are you executing this query? Do you get this error in Management Studio? – Martin Smith May 30 '13 at 13:44
  • From SQLExplorer. I'm running on a Mac. – Greg Dougherty May 30 '13 at 14:17
  • Yes I would presume it is a JDBC issue. Maybe you could try other methods such as `SET STATISTICS PROFILE ON` or `SET STATISTICS XML ON` – Martin Smith May 30 '13 at 16:34
  • SET STATISTICS requires the call to complete before you get any information, yes? My problem is that the call isn't completing (it takes over half an hour, and the connection I was on was dropping before the call completed). – Greg Dougherty May 31 '13 at 16:57
  • Same issue was reported in 2012 https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5c272ad5-45a2-447f-8733-4ffd943f27db/jdbc-driver-throws-exception-with-set-showplanall-on-when-setmaxrows-was-set?forum=sqldataaccess . Now with JDBC 6.0, still the same symptom... : ( – Ben May 09 '17 at 15:42

0 Answers0