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 8207929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:09:54+00:00 2026-06-07T09:09:54+00:00

I am using following query to check it on SQL Server 2008, the error

  • 0

I am using following query to check it on SQL Server 2008, the error I am getting is

Msg 102, Level 15, State 1, Line 13 Incorrect syntax near ‘.’.

Query:

SELECT total_worker_time/execution_count AS AvgCPU  
, total_worker_time AS TotalCPU
, total_elapsed_time/execution_count AS AvgDuration  
, total_elapsed_time AS TotalDuration  
, (total_logical_reads+total_physical_reads)/execution_count AS AvgReads 
, (total_logical_reads+total_physical_reads) AS TotalReads
, execution_count   
, SUBSTRING
    (
      st.TEXT, (qs.statement_start_offset/2)+1, 
      (
        (
           CASE qs.statement_end_offset 
             WHEN -1 THEN datalength(st.TEXT)  
             ELSE qs.statement_end_offset  
             END - qs.statement_start_offset
         )/2
       ) + 1
    ) AS txt  
, query_plan
FROM sys.dm_exec_query_stats AS qs  
cross apply sys.dm_exec_sql_text(qs.sql_handle) AS st  
cross apply sys.dm_exec_query_plan (qs.plan_handle) AS qp 
ORDER BY 1 DESC

Line number 13 is

FROM sys.dm_exec_query_stats AS qs

not sure what the issue is

My SQL Server version is:

Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64)   
Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600)
  • 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-06-07T09:09:56+00:00Added an answer on June 7, 2026 at 9:09 am

    Your database is in 2000 compatibility mode. Once you do this, your query will work:

    ALTER DATABASE YourDatabase SET COMPATIBILITY_LEVEL = 100;
    

    Note that it may be in 80 mode for a reason, but usually this is just a forgotten step during an upgrade or migration.

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

Sidebar

Related Questions

I am using MSSQL 2005 Server and I have the following SQL query. IF
I am using PHP to query some data on SQL Server 2008 R2 and
I am using following SQL Query: SELECT `comment`.`id` AS `comment_id` , count( `comment_likes`.`comment_id` )
The following line is giving an error message. $query = 'SELECT * FROM products
I am running the following query, but getting an error. I think it is
I ran a MySQL query from command line using the following: nohup mysql --user=root
I'm using the following SQL query: SELECT * FROM Articles WHERE Name = 'Name'
I am using following query which works fine for me except one problem SELECT
using the following query in SQLDeveloper to test merge everything goes fine: merge into
Using the following query I am looking for a solution to get the latest

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.