﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 Performance Tuning  / Syntax error on executing this Performance tuning query / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 11:34:11 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Syntax error on executing this Performance tuning query</title><link>http://www.sqlservercentral.com/Forums/Topic469908-360-1.aspx</link><description>Probably compatability mode. What do the following queries return?SELECT @@versionexec sp_dbcmptlevel &amp;lt; Name of the database you're in &amp;gt;</description><pubDate>Sun, 16 Mar 2008 06:58:01 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Syntax error on executing this Performance tuning query</title><link>http://www.sqlservercentral.com/Forums/Topic469908-360-1.aspx</link><description>Huh, it works just fine for me.Are you sure the is SQL Server 2005?  Is the database possibly in compatibility mode=80?</description><pubDate>Sat, 15 Mar 2008 17:16:59 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>RE: Syntax error on executing this Performance tuning query</title><link>http://www.sqlservercentral.com/Forums/Topic469908-360-1.aspx</link><description>FYI, you have to quote the color, "red" in the color tag.</description><pubDate>Sat, 15 Mar 2008 17:12:13 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>Syntax error on executing this Performance tuning query</title><link>http://www.sqlservercentral.com/Forums/Topic469908-360-1.aspx</link><description>Hi guys,  I am executing this query in the query analyzer 2005.I am the sysadmin to the server.when I executed this query it errored with a syntax error as highlighted in red . please help mesyntax error Server: Msg 102, Level 15, State 1, Line 13Incorrect syntax near '.'.select  top 10 qs.sql_handle, qs.execution_count      , qs.total_elapsed_time, qs.last_elapsed_time     , qs.min_elapsed_time, qs.max_elapsed_time     , qs.total_clr_time, qs.last_clr_time     , qs.min_clr_time, qs.max_clr_time     , 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 statement_text  from sys.dm_exec_query_stats as qs[b][color=red] cross apply sys.dm_exec_sql_text(qs.sql_handle) as st[/color][/b]</description><pubDate>Sat, 15 Mar 2008 16:37:05 GMT</pubDate><dc:creator>jaiganesh-489973</dc:creator></item></channel></rss>