-
How to Open PowerShell as Administrator
Running PowerShell commands with elevated privileges is often necessary when configuring system settings, installing software, or troubleshooting issues. This post covers most methods to open PowerShell as an administrator on Windows, ensuring you have the necessary permissions for advanced operations. Methods Covered in This Guide:1. Open PowerShell as…
-
How to Filter Objects in SSMS
SQL Server Management Studio (SSMS) offers a quick filtering feature that lets you narrow down your search by criteria such as name, schema, or creation date, which will definitely save you some time. When working with large databases with a lot of objects in SQL Server, finding specific…
-
The Evolution of Microsoft SQL Server
Microsoft SQL Server is a Relational Database Management System (RDMS) developed by Microsoft. It has undergone many evolutions since its initial release in 1988 (the year I was born). I thought today I’d write about the history of MSSQL, and include whatever thoughts I have along the way…
-
SQL Server Script: Enable or Disable All SQL Agent Jobs
SQL Server Agent jobs automate tasks within SQL Server, but there are times when you need to enable or disable multiple jobs, such as during maintenance, troubleshooting, or system upgrades. This guide provides a script that generates SQL commands to enable or disable all SQL Server Agent jobs…
-
PowerShell Script: List Files with Sizes and Dates
In this blog post, we’ll go through the steps for using a PowerShell script that lists files in a directory along with their sizes and creation dates. This script is useful for disk space and for checking old files in a folder. List Files with Size and Last…
-
Why Is the Database in “In Recovery” Mode?
In this post I’m hoping to help you resolve issues if your SQL Server Database is stuck “in Recovery” Mode. SQL Server enters recovery mode to ensure data integrity by:> Analyzing Transactions: Identifies changes since the last checkpoint.> Redoing Transactions: Reapplies committed changes not yet written to the…
-
How to View the Definition of a Stored Procedure
In this post, I’m sharing some SQL Scripts that will help you view the definition text of Stored Procedures and other objects in SQL Server. Ways to Query Stored Procedure Text Like a lot of tasks in MSSQL, there’s various ways we can get this information, including:> sys.sql_modules:…
📌 Useful SQL DBA Scripts
Performance
– Quick Performance Troubleshooting Scripts
– Get Current User Activity & Blocking
– Get Exclusive Locks on Tables
– Get Wait Stats & Top Consuming Queries
– Identify Missing & Unused Indexes
– Get SQL Server Hardware Info
High Availability
– Get Always On Availability Group (AAG) Latency
– Get Mirroring Status & Latency
– Get Replication Latency
– Get Last Node Blip in SQL Server FCI
Maintenance
– Get Estimated Database Backup/Restore Time
– Get Last Database Backup Dates/Times
– Get Database Sizes & Space Used
– Get Table Sizes in SQL
– Get Index & Heap Fragmentation Levels
Security & Auditing
– Get SQL User Permissions and Roles
– Creating SQL Users on Availability Groups
– Audit Failed Login Attempts
Categories
– AWS
– DBA Stories
– Linux
– MySQL
– Other
– Postgres
– PowerShell
– Redshift
– SQL Server
– Windows Server
Tags
Always On Availability Groups (AAG) (4) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (76) Database Backups & Recovery (14) Database Mirroring (2) Deleting Data (1) Error Messages (5) Git Commands (5) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) PowerShell Scripts (1) SQL Server Agent (5) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (15) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (2) SQL Server Processes (5) SQL Server Replication (2) SQL Server Scripts (13) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (19)