Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6921073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:13:46+00:00 2026-05-27T10:13:46+00:00

My db server is is having continuous high CPU load for the past few

  • 0

My db server is is having continuous high CPU load for the past few days. While investigating this, I was looking at the currently executing requests using the query

SELECT session_id,
       request_id,
       Db_name(database_id),
       start_time,
       status,
       command,
       Substring(txt.TEXT, ( statement_start_offset / 2 ) + 1,
       ( ( CASE statement_end_offset
       WHEN -1 THEN Datalength(txt.TEXT)
       ELSE statement_end_offset
                                                                   END
           - statement_start_offset ) / 2 ) + 1) AS statement_text,
       wait_type,
       wait_time,
       blocking_session_id,
       percent_complete,
       cpu_time,
       reads,
       writes,
       logical_reads,
       row_count
FROM   sys.dm_exec_requests
       CROSS APPLY sys.Dm_exec_sql_text([sql_handle]) AS txt
WHERE  session_id <> @@SPID
       AND session_id > 50 

Most of the time I find that apart from the regular queries sent by application server, there are these weird S queries which seem to be consuming a decent slice of CPU time.
e.g.

Screen shot from query analyzer I took yesterday for the above query

They do not appear on the SQL profiler. Anybody has ideas what are they and what should be done about them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:13:47+00:00Added an answer on May 27, 2026 at 10:13 am

    My guess is that if you capture the whole of txt.text along with statement_start_offset statement_end_offset that you will find that there are some circumstances where the offset columns can both turn out to be 0 and so the displayed statement_text is truncating to only show you the first character of the SELECT query.

    DECLARE @text nvarchar(max); 
    SET @text = 'SELECT .....';
    DECLARE @statement_start_offset INT; 
    SET @statement_start_offset = 0;
    DECLARE @statement_end_offset INT;
    SET @statement_end_offset = 0;
    
    
    SELECT 
           Substring(@text, ( @statement_start_offset / 2 ) + 1,
           ( ( CASE @statement_end_offset
           WHEN -1 THEN Datalength(@text)
           ELSE @statement_end_offset END
               - @statement_start_offset ) / 2 ) + 1) AS statement_text
    

    I couldn’t find any indication of when statement_end_offset would return 0 rather than -1 though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create simple server having low load. The goal is to give
I uploaded my files to my remote server having support for ASP.Net 3.5. Website
We are using CruiseControl with a StarTeam server and having problems with the StarTeam
I've an asp.net page having a server side submit button and 2 textboxes which
I'm having trouble with SQL Server 2008 (Express with Advanced Services) Reporting Services permissions.
We are having problem with the server migration. We have one application that are
I am having problems with SQL Server dropping a connection after I have dropped
We are having issues with our SQL Server. About two times a day we
I'm having a problem with using server callbacks to web methods within an object
I'm having problems installing SQL Server as prerequisite on my Visual Studio Setup application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.