A reader attached a client database and it showed as Read Only. Two simple ALTER DATABASE scripts switch a database to READ_ONLY and back to READ_WRITE.
SQL SERVER – Finding Location of Log File when Primary Datafile is Crashed
Do you need the primary datafile to back up the log after a crash? Vinod Kumar asked, so I tried finding the location of the log file without it.
SQL SERVER – Query to Recent Query on Server with Execution Plan Function to Get SQL
For T-SQL Tuesday on the APPLY clause, I share the script I use to see each recent query on server along with its execution plan from the cache.
hierarchyid GetDescendant: Insert Between Siblings
hierarchyid GetDescendant can generate a sibling location before, after or between existing bounds. This read-only example computes paths without inserting records or guaranteeing allocation.
Partition Stats Permissions: A SQL Server 2025 CU9 Counterpoint
A controlled SQL Server 2025 CU9 test separates partition metadata visibility from access to table rows. Compare the documented permission pair with observed grant behavior, and keep the build-specific result within its measured scope.
STARTUP_STATE: Check Whether an Extended Events Session Is Running
STARTUP_STATE controls automatic startup after SQL Server starts, while current session state tells whether an Extended Events session is running now. Compare both states and verify an event-file capture before assuming that a setting started the session.
SQL SERVER – Denali – ObjectID in Negative – Local TempTable has Negative ObjectID
On Denali I saw many negative ObjectID values in sys.all_objects. Here is how I found out that each local temp table gets a negative ObjectID.







