Where do old statistics go when a database becomes read-only? The location of statistics created before the change stays the same, and they remain permanent.
SQL SERVER – Statistics for Read-Only Database are in TempDB
Statistics usually live in the same database as the table, so where do they go for a read-only database? The answer is TempDB. Here is how it works.
SQL SERVER – MySQL – Order Column by Nearest Value for Any Integer
How do you order column values by how close they are to any integer, such as -5? Here is a script that works the same way on SQL Server and MySQL.
SQL SERVER – Export Data AS CSV from Database Using SQLCMD
We often import CSV into SQL Server, but how do you export data as CSV with SQLCMD? Two simple commands, one with column headers and one without.
XQuery Comparisons: General Equality Is Not Singleton Equality
XQuery Comparisons use different rules for general sequence operators and singleton value operators. I make equality and inequality visible side by side. A general unequal-pair result is not always the inverse of an equal-pair result.
MySQL – How to Write Loop in MySQL
MySQL does not let you loop in ad-hoc SQL. Here is how to write a loop in MySQL with a simple stored procedure that uses LOOP, ITERATE and LEAVE.





