SQL Server Performance

"unbiased" Query CP Usage

Discussion in 'SQL Server 2005 General DBA Questions' started by BobbyK, Aug 7, 2006.

  1. BobbyK New Member

    I am trying to Log Server CPU time for queries by each user. My Front end is VB.NET. What T-SQL can I use to return the CPUusage of the submitted query? This number should be unbiased on the Client Configuration, Network congestion and speed etc. For example, is the "CPU Time" returned by "SET STATISTICS TIME ON" as good measure of the CP Usge, or will the same query return different CPU Times from different clients?

    Thank you.
  2. joechang New Member

    i do not believe there is a good way of doing this
    unless each user connects directly to SQL Server (without going through an web/app server)
    in which case you can use profiler

    but you might think real hard about whether you must absolutely have this capability or just think its a neat trick
  3. BobbyK New Member

    No - it's not a neat trick at all. I have been asked to formulate a methodology to "charge" projects using the database based on cpu time (or some other parameter).

    There is no middle tier. This is an Intranet Application - so the front end talks directly with the SQL Server.

    Hope this gives you some more information.

  4. joechang New Member

    use profiler
    include the hostname column

Share This Page