Category: Storage & Capacity
-
Set a Maximum Database File Size in SQL Server (MAXSIZE)
Find existing MAXSIZE caps, set one in T-SQL or SSMS, and what SQL Server 2025 does at the cap: 1105 for a data file, 9002 for a log, 5040 if you cap below the current size.
Written by
-
DBA Scripts: Get Identity Column Usage
Find every SQL Server identity column close to its data type limit, before inserts fail with Msg 8115: arithmetic overflow converting IDENTITY to int.
Written by
-
How to Move TempDB Files in SQL Server
TempDB on the C: drive is a problem waiting for a busy day. It can grow very large, very quickly, sometimes within minutes under the right workload, and when it fills the OS drive it takes the whole server down with it. Moving the tempdb files to their own drive is a standard best practice,…
Written by
-
Add a Filegroup to a SQL Server Database
ADD FILEGROUP then ADD FILE, and the trap in between: a filegroup with no files will accept a CREATE TABLE and only fail at the first INSERT with Msg 622. Placing objects, changing the default, and removing one again.
Written by
-
DBA Scripts: Get Autogrowth History
SQL Server autogrowth is one of those settings that is often ignored until it becomes a production problem. A database file growing during normal business hours is usually a sign that SQL Server is reacting to a capacity issue. The engine pauses normal operations, extends the data or log file, then continues processing. Depending on…
Written by
-
DBA Scripts: Get Transaction Log Size and Usage
Full Log Versus Big Log A transaction log that fills stops every write in the database with error 9002, and disk monitoring will not warn you first, because a log can fill up inside a file that never grew. A 500 GB log with 20 GB in use is fine. A 20 GB log at…
Written by
-
DBA Scripts: Get Log Reuse Waits
The One Question That Actually Matters A transaction log that won’t truncate and keeps growing, or a log backup job that suddenly can’t keep up, always comes back to the same underlying question: what is this database’s log actually waiting on before it can reuse space? SQL Server tracks the answer directly, log_reuse_wait_desc, one value…
Written by
-
DBA Scripts: Get TempDB Configuration
TempDB is shared by every database on the instance, and it’s usually the first thing to show contention under load, long before any user database does. Setup has created 1 data file per core (up to 8) since SQL Server 2016, but an older instance or one upgraded in place can still be running a…
Written by
-
DBA Scripts: Get Table Sizes
Walk onto a new SQL Server instance and the first honest question is usually “where’s all the space going.” Not at the database level, sys.master_files answers that in seconds, but at the table level, inside a database that’s grown for years without anyone tracking which objects are actually driving the size. Backups take longer than…
Written by
-
DBA Scripts: Get SQL Server Database File Details
Understanding SQL Server Database File Layout A disk alert has fired, or a log file has grown again, and you need to know which file it is, where it lives and whether anything stops it growing. The same questions come up in every health check and migration: Where are my database files stored? How large…
Written by
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)