Understanding SQL Server Error Logs

Scenario SQL Server error logs are logs that store important information about events, warnings, and errors encountered by the SQL Server instance. These logs act as a valuable source of diagnostic data, assisting administrators and developers in identifying and resolving…

Read More →

TSQL to find index fragmentation in SQL Server

To determine index fragmentation in SQL Server, you can use the following steps: SELECT OBJECT_NAME(DMV.object_id) AS TABLE_NAME , SI.NAME AS INDEX_NAME , avg_fragmentation_in_percent AS FRAGMENT_PERCENT , DMV.record_count FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, ‘SAMPLED’) AS DMV LEFT OUTER JOIN SYS.INDEXES AS…

Read More →