Browse Source

New fix for function stats section

Fixed function stats query failing in SQL Server 2012 and 2014.
pmasl 6 years ago
parent
commit
e0b13d38d8
2 changed files with 2 additions and 1 deletions
  1. 1 0
      usp_WhatsUp/README.md
  2. 1 1
      usp_WhatsUp/usp_whatsup.sql

+ 1 - 0
usp_WhatsUp/README.md

@@ -41,3 +41,4 @@ In the output, you will find the following information in 6 sections:
    -  Fixed unbound column in Function stats section;
    -  Added more information to Query stats section.
 -  04/15/2019 Added support for input buffer DMF.
+-  04/17/2019 Fixed function stats query failing in SQL Server 2012 and 2014.

+ 1 - 1
usp_WhatsUp/usp_whatsup.sql

@@ -598,7 +598,7 @@ CROSS APPLY sys.dm_exec_query_plan(ts.plan_handle) qp'
 END;
 
 -- Function stats
-IF @fnstats = 1 AND @sqlmajorver >= 11
+IF @fnstats = 1 AND @sqlmajorver >= 13
 BEGIN
 	SET @sqlcmd = N'SELECT CASE WHEN fs.database_id = 32767 THEN ''ResourceDB'' ELSE DB_NAME(fs.database_id) END AS DatabaseName, 
 	CASE WHEN fs.database_id = 32767 THEN NULL ELSE OBJECT_NAME(fs.[object_id], fs.database_id) END AS ObjectName,