... sys.dm_exec_query_stats AS qs ON qs. [sql_ handle] = COALESCE( r. [sql_ handle], c.most_recent _sql_ handle) OUTER APPLY sys.dm_exec _sql_ text(COALESCE( r. [sql_ handle], c.most_recent _sql_ handle, qs. [sql_ handle])) AS ... of the DATEDIFF() function.In SQL Server 2008 I use sys.dm_os_sys_info, but in SQL Server 2005, I must useother workarounds. You can use the SQL Server 2005 version of the function ... version of your instance: SQL Server 2008 :CREATE FUNCTION dbo.AB_Uptime()RETURNS TABLE ASRETURN ( SELECT sqlserver_start_time, uptime = DATEDIFF(MINUTE, sqlserver_start_time, CURRENT_TIMESTAMP)...