A classic interview question: what happens when adding file to database in an AlwaysOn Availability Group? Here is the answer, with the basics first.
SQL SERVER – Inserting into Sparse Column Sets and Errors Associated With It
You can write to sparse column sets directly, not just read them. I show how to insert into column sets and the errors you hit without an explicit column list.
How to Find Queries Running in Parallel in SQL Server
To find queries running in parallel, read max_dop and the CPU to elapsed ratio from the query stats view, then confirm with the plan XML. This post tests both on a two million row table. It also explains why the same query stays serial until its cost passes the threshold.
SQL SERVER – FIX – Property IsLocked is Not Available for Login
Opening sa login properties in SSMS failed with Property IsLocked is not available for Login. I used Profiler to find the query returning NULL, and here is the fix.
SQL SERVER – Querying Performance Counters from SQL Server
When SQL Server is slow, where do you start? I look at querying performance counters from inside SQL Server as a quick way to see what is going on.
SQL SERVER – How to Change Server Name?
I renamed my VM and needed SQL Server to match. Here is a query that shows the host and server names from every source, and how to change server name.
PostgreSQL Local Variable: DECLARE in a plpgsql Function
A PostgreSQL local variable is declared in the DECLARE section of a plpgsql function or DO block. This post tests a function with two variables, the NULL start value, scope, CONSTANT, STRICT, a name clash error and the psql alternative.





