Frequently run stored procedures leave an execution count in the plan cache. A tested demo ranks three procedures by count, reads and calls per minute. It also shows what the cache forgets and when to use Query Store instead.
How to Write in Text File from T-SQL in SQL Server? – Interview Question of the Week #236
Question: How to Write in Text File from T-SQL in SQL Server?
The question above was actually asked in an interview and also was not asked in the same word.
Compiled Parameter Values in SQL Server: Read Them From the Cache
Compiled parameter values show which value SQL Server used when it built a cached plan. This post reads them from the plan cache with one query, then shows how the first caller shapes the plan for everyone after. It ends with the usual ways to break that link.
Finding Procedures That Reference Databases That No Longer Exist
Find procedures that reference databases missing from the instance, retain review coverage, and check dynamic SQL and synonyms separately.
Dynamic SQL Result Into a Variable with sp_executesql
To get a dynamic SQL result into a variable, use sp_executesql with an OUTPUT parameter. This post tests the pattern on a small demo, explains Msg 214 and shows counts, JSON, new identity values and generic table names. It also covers INSERT with EXEC for result sets.
Finding Hard-Coded Passwords in Stored Procedures
A short regular expression can list the procedures that hide a password, without printing it. Here is the scan, its false alarms and its blind spots.







