Mehdi Lorvand's repositories
KillOtherSessions
A powerful and safe T-SQL stored procedure that **automatically kills all active SPIDs** connected to a specific database — except your current session. Perfect for **maintenance, restore operations, or exclusive access** requirements.
sp_usp_ListFiles
A lightweight stored procedure for monitoring **database file sizes (MDF, LDF)** in any SQL Server database. It dynamically queries the target database and shows total, used, and max size of each file.
AG_HealthCheck
A query for overview all primary and replica servers in an AG
FilegroupSpaceUsed
It shows each file’s logical name, path, total size, and used space (in MB)
FreeSpaceDrive
This query show your server all drives status with capacity counter and percentage value
CollationDetails
This SQL script provides a complete overview of collation settings for all text-based columns (char, varchar, nchar, nvarchar, etc.) across user tables in a database.
FileGrowth
SQL Server script to display the current status of database files, including auto growth configuration, growth type (percent or KB), maximum size, and physical file location.
sql-index-analyzer
Script for analyzing SQL Server index structure and filegroup usage