Problem:- One of the pain point in any SQL engineer is “Performance”. There are various reasons due to which your SQL Server database is slow. One of the possible reason is your maintenance. You don’t know when statistics last updated and take further step if those are not updated Solution:- Here we have simple …
Problem:- Many times you want to know how many rows exists in the particular tables. So let me share 3 different way to know this thing Solution:- Let me share 3 different options Option 1:- You all aware of this term which is Count function SELECT COUNT(1) As Rows FROM [Person].[Person] Option 2:- Sp_Space …
To determine last statistics update we need to run following command. GoSELECT o.name, i.name AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date], s.auto_created, s.no_recompute, s.user_createdFROM sys.objects AS o WITH (NOLOCK)INNER JOIN sys.indexes AS i WITH (NOLOCK)ON o.[object_id] = i.[object_id]INNER JOIN sys.stats AS s WITH (NOLOCK)ON i.[object_id] = s.[object_id] AND i.index_id = s.stats_idWHERE o.[type] …