Category: Microsoft SQL Server

Microsoft SQL Server Blog which includes troubleshooting, performance tuning, and database administration guides from an experienced SQL DBA, Peter Whyte.


  • How to Backup a SQL Server Database

    Ensuring regular backups of your SQL Server database is essential for data protection and disaster recovery. Whether you prefer using SQL commands or SQL Server Management Studio (SSMS), this guide will walk you through both methods. Backing Up a SQL Server Database Using T-SQL If you want a…

    Read More


  • Restoring a Full Database Backup in SQL Server

    In this post I’m sharing a demo of restoring a Full database backup using the SQL Server Management Studio (SSMS) Restore Database Wizard. I often find myself running through the SSMS Restore Database Wizard and scripting out the SQL to a new query window when running an ad-hoc…

    Read More


  • How to Properly Copy SQL Dates into Excel

    When copying a SQL query result directly into Excel, DATETIME columns often don’t display as expected. Excel doesn’t seem to handle milliseconds well, making the dates appear messy. The Issue: Excel Precision Struggles Here’s an example of data I copied over from SQL Server into an Excel sheet.…

    Read More


  • What is Stack Exchange Data Explorer (SEDE)?

    As a DBA, I’ve found Stack Exchange Data Explorer (SEDE) to be an invaluable tool for analyzing data from the Stack Exchange network. It’s essentially a web-based SQL playground, allowing you to run queries and uncover hidden insights without downloading any data. Just open the tool, write a…

    Read More


  • sp_who, sp_who2 & sp_whoisactive

    Ever wondered what’s happening inside your SQL Server instance? sp_who, sp_who2 and sp_whoisactive are stored procedures that allow you to view current users, sessions, and processes within a SQL Server instance. This kind of information helps you diagnose blocking issues and monitor general activity. Among them, sp_whoisactive is…

    Read More


  • SQL Server Script: Get Database Growth Events

    In SQL Server, database growth events occur when the database files automatically expand to accommodate more data. These events are essential to monitor because frequent auto-growth can impact performance, causing fragmentation and increased disk I/O during expansions. Proper configuration of file growth settings is crucial to maintaining optimal…

    Read More


  • Understanding Implicit vs. Explicit Data Conversion in SQL Server

    This post is here to help you understand implicit vs explicit data conversions in SQL Server. What is Data Conversion? Data conversion involves transforming data from one type to another. SQL Server facilitates this through two primary methods: Implicit Conversion> Occurs automatically when SQL Server can safely convert…

    Read More


  • Show Line Numbers in SQL Server Management Studio (SSMS)

    This is a quick tip on how to show line numbers in SQL Server Management Studio (SSMS) query windows. Enabling line numbers can be useful, especially when you get an error message that points to a specific line in your code. While not strictly necessary, some developers prefer…

    Read More


  • Show Available Disk Space in SQL Server

    This blog post is to share a script that you can run in SQL Server (versions 2008 R2 and above) which shows the available disk space for all local volumes on a SQL Server host. I’m also including a quick note on how to get this information with…

    Read More