akhamoshioke (6/3/2014)
Please do and post your feedback on the flaws with it and possible fixes so i can keep improving it.
Thanks for this script!
It works great on SQL Server 2008 R2 Enterprise Edition.
On SQL Server 2005 Standard Edition, however I got these errors when I tried to run it.
Msg 139, Level 15, State 1, Line 0
Cannot assign a default value to a local variable.
Msg 137, Level 15, State 2, Line 10
Must declare the scalar variable "@debugFlg".
Msg 137, Level 15, State 2, Line 11
Must declare the scalar variable "@ServerTime".
Msg 137, Level 15, State 2, Line 20
Must declare the scalar variable "@ServerTime".
Msg 137, Level 15, State 2, Line 43
Must declare the scalar variable "@FilterHours".
Msg 137, Level 15, State 2, Line 51
Must declare the scalar variable "@debugFlg".
Msg 137, Level 15, State 2, Line 66
Must declare the scalar variable "@ConvertMiliSeconds".
Any thoughts on how to fix this? Or does the code need to be modified for SQL 2005?
Thanks again,
webrunner
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html