To enable SQLCMD mode in SSMS, use the Query menu or set it as the default for new windows. This post tests :connect, :setvar, :r, !! and :on error exit with sqlcmd.exe on SQL Server 2025 and shows the Msg 102 error you get when the mode is off.
SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
SQL SERVER – Fix : Error: 257 Implicit conversion from data type datetime to int is not allowed.
Implicit conversion from data type datetime to int is not allowed. I hit this error with ISNULL and a date, and the fix is right in the message: use CONVERT.
SQL SERVER – The procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead.
Why does SQL Server say a procedure attempted to return a status of NULL and returns 0 instead? A reader asked on Facebook, and I explain what it means.
How to Pass Stored Procedure Result to Another Procedure in SQL Server
To pass stored procedure result values from one procedure to another, use an OUTPUT parameter. This post tests RETURN codes, INSERT … EXEC and table-valued parameters on a small order demo. It also shows the errors each method raises and when a function is the better tool.
Auditing WITH GRANT OPTION: Who Can Hand Out Permissions
Audit WITH GRANT OPTION at database and server scope, trace delegated permissions, and remove delegation with a reviewed CASCADE plan.
SQL SERVER – Group by Rows and Columns using XML PATH – Efficient Concating Trick
A reader wanted students and courses grouped by course and instructor in a single row. Here is a simple concatenation trick with XML PATH that does it.
What Is a Deadlock in SQL Server?
A deadlock in SQL Server is two sessions each holding what the other needs. I caused one on purpose and read error 1205. Why it is not the same as blocking, who gets killed, and the boring fix that works.
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.

