Skip to Content

Adaptive Server Enterprise ADO.NET Data Provider - SET SHOWPLAN ON

Hi, I am trying to perform a SHOWPLAN on a query in order to see how it will run but I cannot seem to get it to return the SHOWPLAN using the ADO .NET Data Provider. It does not matter what the query is, SHOWPLAN does not return any information.

Query:

SET NOEXEC ON
SET SHOWPLAN ON


SELECT
	*


FROM
	table_name


WHERE
	id = 1

C#:

using (this._DBCommand = this._DBConnection.CreateCommand())
{
    this._DBCommand.CommandText = _Command;
    this._DBCommand.CommandTimeout = this._QueryTimeout;


    using (AseDataAdapter _DBDataAdapter = new AseDataAdapter(this._DBCommand))
    {
	_DBDataAdapter.Fill(_DataSet);
    }
}

The C# code will not fill the DataSet object with any information. I have tried the AseDataReader as well but the result is the same, no information. Any help would be greatly appreciated.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 09, 2018 at 08:05 PM

    Hi,

    The showplan is actually not a dataset or result set.
    Showplan is a message.
    Example from TDS (Ribo):

    EED Token (0xE5); variable length.
    Length [2]: 62
    Message Number [4]: 10262
    Message State [1]: 1
    Message Class [1]: 10
    SQL State Length [1]: 5
    SQL State [5]: "ZZZZZ"
    Status [1]: NO_EED (0x00)
    Transaction State [2]: TDS_TRAN_SUCCEED (0x0001)
    Message Length [2]: 37
    Message Text [37]: " The type of query is SELECT. "
    Server Name Length [1]: 4
    Server Name [4]: "asename"
    Stored Proc. Name Length [1]: 0
    Line Number [2]: 0

    You would need to capture warning/information messages:
    I believe this is what you are looking for
    http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20066.0215/html/adonet2155/Infomessage_adodotnet_apir.htm

    Or you can do what I did and use Ribo.
    https://wiki.scn.sap.com/wiki/x/UgKlFw
    https://wiki.scn.sap.com/wiki/x/xYP8Ew

    Regards,
    Ryan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.