Author: Peter Whyte
-
How to Check Table Sizes in SQL Server
In this post, I’m sharing different ways of checking table sizes in SQL Server. There’s many ways to get this information, and whether you prefer using T-SQL scripts for automation, or SSMS tools for quick checks, these methods offer flexibility for different situations as a SQL Database Administrator.…
-
Creating Folders (If Not Exists) with PowerShell
If you need to create folders or subfolders in PowerShell only when they don’t already exist, this quick script will help. The script uses Test-Path to check if the folder exists before running the New-Item command. This snippet is ideal for anyone searching for a fast and reliable…
-
Advanced File and Folder Creation with PowerShell
This post contains an advanced guide for creating and managing files and folders in PowerShell. It builds on the basics introduced in my previous post, PowerShell Guide: Creating Folders and Files, and includes more techniques useful for a DBA or Sysadmin. Contents: 1. Creating New Files and Folders2.…
-
How to Restart Windows Subsystem for Linux (WSL)
If your Windows Subsystem for Linux (WSL) instance encounters errors or you’ve updated the .wslconfig file (e.g., to modify memory limits), restarting your WSL distributions may be necessary. This guide demonstrates two effective methods for restarting WSL distributions: > (Preferred Approach) Run the WSL –Shutdown Command > (Old…
-
How to Upgrade WSL from Version 1 to Version 2
This guide explains how to upgrade your Windows Subsystem for Linux (WSL) distribution from Version 1 (WSL 1) to Version 2 (WSL 2). WSL supports two versions: the original WSL 1 and the more advanced WSL 2. You can install multiple Linux distributions on your system and easily…
-
How to Downgrade from WSL Version 2 to WSL Version 1
In certain development or system administration scenarios, you may need to downgrade your Windows Subsystem for Linux (WSL) distribution from WSL version 2 (WSL 2) to version 1 (WSL 1). While WSL 2 brings many enhancements, such as a real Linux kernel and better performance, there are times…
-
How to Check Linux Version in Ubuntu
To check the Linux version running on an Ubuntu system, you can use the lsb_release -a or cat /etc/os-release commands. This is especially useful when accessing a host for the first time or verifying the installed Linux distribution and version. In this post, I’ll demo two ways to…
-
How to Open WSL Projects in Windows File Explorer
This is a guide on how to open WSL files in Windows File Explorer, with added descriptions. The best practice for managing project files in WSL is to store your files on the same Operating System as the tools your plan to use. So if the reason you’re…
-
Drop Table if Exists in SQL Server
The DROP TABLE command in SQL Server is used to remove a table from the database permanently. However, attempting to drop a non-existent table can result in execution errors. To prevent this, SQL Server 2016 introduced the DROP TABLE IF EXISTS command, which makes the process more efficient…
-
How to Change Your Default Distro in WSL
Changing the default Windows Subsystem for Linux (WSL) distribution is simple. This guide shows you how to list your installed distros and set a new default using just a couple of commands. 1. Listing Installed WSL Distributions Before setting a new default, check which distributions are installed on…
Recent Posts
- Granting the VIEW SERVER STATE Permission in SQL Server
- Why Is the Database in “In Recovery” Mode?
- How to View the Definition of a Stored Procedure
- SQL Script to Show Exclusive Locks on Tables
- How to Get SQL Server’s IP Address
Categories
– AWS
– DBA Stories
– Linux
– MySQL
– Other
– Postgres
– PowerShell
– Redshift
– SQL Server
– Windows Server
Tags
Always On Availability Groups (AAG) (3) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (74) Database Backups & Recovery (13) Database Mirroring (2) Deleting Data (1) Error Messages (4) 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 (4) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (14) 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)