Troubleshooting Arithmetic overflow errors in queries using Extended Events in SQL Server 2008

Problem: Management view sys.dm_exec_requests has a column total_elapsed_time to track the total time elapsed in milliseconds since the request arrived. Following T-SQL query converted this value from milli-seconds to micro-seconds. — Simplified version of a complex T-SQL batchSELECT  session_id, command,r.total_elapsed_time * 1000 AS total_elapsed_time_in_ms — Convert ms to us. FROM sys.dm_exec_requests AS r Sometimes the above query throws Arithmetic…

1

Execute a query on servers in Central Management Server Group

MultiServerQuery.ps1 # Scenario: Execute a query on servers listed in  Central Managment Server Group # #  How to use this powershell script: #    – Launch SQL Server PowerShell ( Start -> Run -> sqlps.exe) #    – Copy the following powershell script and paste it in powershell window $serverGroupPath = ‘SQLSERVER:\SQLRegistration\Central Management Server Group’ # #…

1