A database backup does not carry the key that opens your encrypted data. Export both keys, restore one from its file, and see why the password matters.
SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
Pass a Table to a Stored Procedure With a Table Type
To pass a table to a stored procedure, you create a table type and declare a parameter of that type. This post builds a type, a procedure and a call that inserts three classes at once, then a call that inserts a thousand rows, and explains four common errors. Every result comes from SQL Server 2025.
WITH CHECK OPTION in SQL Server: Stop Rows Leaving a View
WITH CHECK OPTION stops a change made through a view from pushing a row out of that view. This post builds a view of large invoices, shows an update and an insert that make rows vanish, adds the option to block both with Msg 550, and compares it with a trigger. Every result comes from SQL Server 2025.
Create a View in SQL Server: Column Rules and Encryption
To create a view in SQL Server you save a SELECT statement under a name. This post builds a view over a small donations table, shows the three rules behind the most common view errors, and tests four ways to read a view’s code before and after WITH ENCRYPTION. Every result comes from SQL Server 2025.
Check Constraint on Existing Data: Clean First, Then Enforce
A check constraint on existing data fails if even one row already breaks the rule. This post finds bad values in a small table of lakes, cleans them, adds the constraint, tightens it with an upper limit, and writes a rule across two columns. It also shows how NULL and WITH NOCHECK behave. Every result comes from SQL Server 2025.
ANY and ALL: Comparing a Value to a Whole Subquery in T-SQL
One missing price is enough to make ALL return nothing while ANY returns rows. Here is how to see it, and how to ask the question more safely.
SQL Statistics: How SQL Server Estimates Row Counts
SQL statistics are small summaries of your data that tell the optimizer how many rows a query will return. This post builds an orders table with one rare value and one common value, reads the histogram, compares estimated and actual rows in the plans, and shows a stale statistic fixed with UPDATE STATISTICS. Every result comes from SQL Server 2025.
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.

