Category: SQL Server

SQL Server Blog Archives, by Peter Whyte (Database Administrator).
Includes: Database Admin, Management Studio (SSMS), Windows Admin, PowerShell, WSL, MSSQL Backups, Restores & more…

  • 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…

    Read More


  • 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…

    Read More


  • 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…

    Read More


  • Database cannot be opened, it is in the middle of a Restore

    If you encounter this error in SQL Server, it means the database is still in the RESTORING state, typically because:> A restore operation is still in progress. > A previous restore failed due to corruption or other issues. > The database is in NO RECOVERY mode and waiting…

    Read More


  • Granting the VIEW SERVER STATE Permission in SQL Server

    In SQL Server, the VIEW SERVER STATE permission allows a user to view server-wide dynamic management views (DMVs) and functions. This is often useful for troubleshooting, monitoring, and performance tuning. In this blog post, I’ll share how to check which users have the VIEW SERVER STATE permission, and…

    Read More


  • 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…

    Read More


  • 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:…

    Read More


  • SQL Script to Show Exclusive Locks on Tables

    In this post I’m sharing a SQL script that will show exclusive locks for all tables in a database, with added info to help you understand what we’re looking at. Exclusive locks are a natural thing in SQL Server which ensures data integrity during updates or deletions by…

    Read More


  • How to Get SQL Server’s IP Address

    When managing or troubleshooting SQL Server, you might need to get the IP address your SQL Server instance is listening on. While servers can listen on multiple IP addresses, SQL Server offers a straightforward way to determine which address is used for your current connection. In this post…

    Read More


  • Identify Missing & Unused Indexes in SQL Server

    Indexes are crucial for SQL Server query performance. Everyone needs an Index. However, improper indexing strategies can degrade database performance, leading to slow queries and cause resource bottlenecks. Effectively managing indexes involves not only identifying the missing ones that could improve performance, but also pinpointing unused indexes that…

    Read More