Tag: DBA Tools
-
DBA Scripts: The Complete Guide
Where to Start With This Series The DBA Scripts series on this blog covers backups, blocking, indexes, SQL Agent, query performance, extended events tracing, server inventory, and security, organized into eight areas of the job, each one tying together a cluster of scripts that answer a related set of questions. That’s a lot of ground,…
Written by
-
Open SSMS as a Different Domain User
⚡Shift + right-click SSMS → Run as different user, or runas /netonly /user:DOMAIN\user “path\to\Ssms.exe”. Use /netonly when the account is in another domain or is not allowed to log on to this machine. You need to connect to SQL Server as a different Windows account: to test a new AD login’s permissions, to reach an…
Written by
-
sqlcmd Examples for SQL Server
No SSMS on the box, or SSMS will not connect, and you need to run a query or a script file from a shell right now. sqlcmd does that from Command Prompt, PowerShell or a Linux shell. On any current install it also refuses the first connection with a certificate error until you add -C,…
Written by
-
Install and Update SQL Server Management Studio (SSMS)
SQL Server Management Studio (SSMS) is the primary management tool for SQL Server and Azure SQL. What changed in recent releases is not how it looks but how it installs, updates and connects: it ships through the Visual Studio Installer, updates every 1 to 2 weeks, and applies stricter encryption defaults by design. If you…
Written by
-
How to Show Line Numbers in SSMS
⚡Tools → Options, search for “line numbers”, and tick Line numbers. Current SSMS has them on already. If they still do not show in query windows, the Transact-SQL language page has its own copy of the setting. Line numbers sit down the left margin of every query window in SSMS 21 and later, with nothing…
Written by
-
DBA Scripts: Get Database Mail and xp_cmdshell Configuration
An audit or a pen test report asks whether xp_cmdshell is on, or alert emails stopped arriving and you need to know whether Database Mail is even switched on. This script answers both in one result, alongside CLR, force encryption and live NTLM sessions. Why Database Mail and xp_cmdshell Matter Each of these settings expands…
Written by
-
DBA Scripts: Check AG Replica Role and Synchronization State
Is Every Replica Actually Ready to Take Over A failover just happened or the AG dashboard has gone red, and you need to know which replica is primary now and whether every secondary is connected and in sync. Run this on the primary: it reads each replica’s role, connection state, synchronization health and last connection…
Written by
-
DBA Scripts: Check Always On Availability Group Latency
How Far Behind Is Each Database, Really A readable secondary is serving stale data, commits on the primary have slowed, or a failover is about to depend on a replica you have not checked. Run this on the primary: it returns every availability database on every replica with its send queue, redo queue and rates,…
Written by
-
DBA Scripts: Get Disk Space on SQL Server
Run Get-DiskSpace when a SQL Server volume is filling and you have SQL access but no RDP. It reports free and used space on database-file volumes, fullest first. Why Disk Space Matters SQL Server does not degrade gracefully when a volume fills. A full data volume means autogrow fails and inserts start throwing errors. A…
Written by
-
DBA Scripts: Get Long-Running Queries
When users report the application is slow, the first question is always the same: what is actually running right now? Not what ran an hour ago, not what the plan cache thinks is expensive on average, but what is executing on the instance at this moment and how long it has been at it. This…
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)