SSMS extention best way to get the statistics

  • Hi

    I started writing an extention to ssms i've got the project working and i would like to ask. What is the best way to get the statitics returned from "set statistics io on;" ?
    i would like to make som calculations on the statistics in my extention.

    Thanks, and happy new year.¨

    Jacob

  • jacob.saugmann - Saturday, December 29, 2018 1:47 AM

    Hi

    I started writing an extention to ssms i've got the project working and i would like to ask. What is the best way to get the statitics returned from "set statistics io on;" ?
    i would like to make som calculations on the statistics in my extention.

    Thanks, and happy new year.¨

    Jacob

    A couple of options depending on how you are doing what -

    InfoMessageEvent of a SQLConnection object would be one way to capture that information. Some examples in this post:
    Access to SQL Server messages via ADO.NET

    Another option would be to look at extended events and keep in mind that different tools handle the read-ahead reads differently. This article should give you some information to get started:
    When does “physical reads†include read-ahead reads in SQL Server?

    Sue

  • Sue_H - Wednesday, January 2, 2019 3:10 PM

    jacob.saugmann - Saturday, December 29, 2018 1:47 AM

    Hi

    I started writing an extention to ssms i've got the project working and i would like to ask. What is the best way to get the statitics returned from "set statistics io on;" ?
    i would like to make som calculations on the statistics in my extention.

    Thanks, and happy new year.¨

    Jacob

    A couple of options depending on how you are doing what -

    InfoMessageEvent of a SQLConnection object would be one way to capture that information. Some examples in this post:
    Access to SQL Server messages via ADO.NET

    Another option would be to look at extended events and keep in mind that different tools handle the read-ahead reads differently. This article should give you some information to get started:
    When does “physical reads†include read-ahead reads in SQL Server?

    Sue

    THANKS Sue
    It looks like it would get me in the right direction.

    Have a nice day

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply