SQLServerCentral.com / Article Discussions / Article Discussions by Author / Discuss content posted by Prakash Heda / Get Top Queries Taxing SQL Server CPUs / Latest PostsInstantForum.NET v2.9.0SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comSun, 02 Aug 2015 16:59:16 GMT20RE: Get Top Queries Taxing SQL Server CPUshttp://www.sqlservercentral.com/Forums/Topic1265292-776-1.aspxI was able to reproduce the issueSeems when one copy the code and run it, it has special character get added due to HTML, invisible though but in windows 2003 notepad and SQL 2012 SSMS editor I was able to see and replace it and than it works, not able to see that character in win7 notepad though. let me know if you this doesn't work...Tue, 13 Mar 2012 17:42:24 GMTPrakash HedaRE: Get Top Queries Taxing SQL Server CPUshttp://www.sqlservercentral.com/Forums/Topic1265292-776-1.aspxAlso update declare variable part like below:declare @ServerTime datetime , @ConvertMiliSeconds bigint , @FilterMoreThanMiliSeconds bigint , @FilterHours bigint, @execution_count bigint , @debugFlg bit select @ServerTime = getdate(),@ConvertMiliSeconds = 1000,@FilterMoreThanMiliSeconds = 1,@FilterHours = 2,@execution_count = 2,@debugFlg bit = 0Tue, 13 Mar 2012 03:29:40 GMTPrakash HedaRE: Get Top Queries Taxing SQL Server CPUshttp://www.sqlservercentral.com/Forums/Topic1265292-776-1.aspxWhat is the version of SQL server you are using? Try commenting the "queryexecuted" column code and run sameCheck this article for [url=http://www.sqlfeatures.com/2012/02/27/detect-worst-performing-sql-queries-part-3/]how to use this script[/url]:Prakashwww.sqlfeatures.comTue, 13 Mar 2012 03:24:18 GMTPrakash HedaRE: Get Top Queries Taxing SQL Server CPUshttp://www.sqlservercentral.com/Forums/Topic1265292-776-1.aspxHello Prakash, Hope this reply finds you well...Thank you very much for the post, by the way I am getting below error.Please help me out to correct the same........Is ther any setting from my SQL Server SMO to be done ?Msg 102, Level 15, State 1, Line 14Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 37Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 49Incorrect syntax near ' '.Mon, 12 Mar 2012 23:54:37 GMTmuthalifGet Top Queries Taxing SQL Server CPUshttp://www.sqlservercentral.com/Forums/Topic1265292-776-1.aspxComments posted to this topic are about the item [B]<A HREF="/scripts/Performance+Tuning/89143/">Get Top Queries Taxing SQL Server CPUs</A>[/B]Mon, 12 Mar 2012 09:15:40 GMTPrakash Heda