To attach a database, use CREATE DATABASE with FOR ATTACH and point it at the data and log files. This post detaches a demo database, attaches it again, shows the error that stops a detach, and compares the old sp_attach_db procedure with the current statement.
SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
BACKUP WITH CHECKSUM: What It Checks and What It Cannot
Use WITH CHECKSUM for backups, inspect checksum history, verify backup media, and understand why restored CHECKDB tests are still needed.
Point-in-Time Restore: Getting Back Rows Deleted by Accident
Plan a point-in-time restore after an accidental DELETE, preserve the log chain, recover a separate copy, and return reviewed rows.
Column Aliases: Where You Can Use Them and Where You Cannot
Why does WHERE say the alias does not exist? Here is the order SQL Server follows, two clean fixes and one quiet trap to avoid.
MySQL – Introduction to CONCAT and CONCAT_WS functions
MySQL has two concatenation functions, CONCAT and CONCAT_WS. I show how each one works and why CONCAT_WS makes adding a separator easier.
SQL SERVER – What are Actions in SSAS and How to Make a Reporting Action
SSAS actions let users open a report, a web page or drill through from cube data. Here is what actions are and how to build a Reporting Action step by step.
SQL SERVER – Planned and Unplanned Availability Group Failovers – Notes from the Field #031
In Notes from the Field #031, John Sterrett explains Planned and Unplanned Availability Group failovers in AlwaysOn, a topic that confuses many DBAs.
SQL Server slow? Let's fix it together in about four hours.
In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.
You keep every script, and the know-how to fix it yourself next time.
Want your whole team to learn it?
My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.
Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.
Who We Are
Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.
Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.
Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).
Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.
Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

