Browse the archive

Databases

Consuming SQL Agent dates & durations

SQL Agent’s schema is older than me. It handles dates, times, and durations like it’s 1980 by using integers instead of date/time data types. My buddy Aaron Bertrand talks more about Dating Responsibly so that you can have a good datetime with your own …

Continue reading

Not all stats should be auto-updated

Statistics auto-updates are generally a good thing–auto-update of statistics is the default behavior in SQL Server. Having the freshest information about the data “shape” helps to inform the best selection of an execution plan for queries. Except for when it …

Continue reading

T-SQL Tuesday: The last ticket I closed

For this month's T-SQL Tuesday, Brent Ozar (blog|Instagram) asks us to describe the most recent ticket we closed. “We had a pretty significant wait spike…” The literal last ticket I closed was “please run this script in production…”, and I don’t think it …

Continue reading

SQL Modulo Function gives the wrong value?

Question In Javascript, Excel, Python, and a scientific calculator, the modulo operation -34086.1576962834 % 360.0 <-- python =MOD(-34086.1576962834, 360.0) <-- Excel function gives a value of 113.84230371659942. (Or something very close to that, depending on …

Continue reading