Running out of disk space on a SQL Server server is something that you should never allow to happen, but it can happen. If you need to be the emergency Fireman putting out the fire, here is a way to “reserve” some drive space ahead of time. It is literally a dummy file that you… Continue reading How to save some Emergency Drive Space for SQL Server (or other Servers)
First, create the test table and populate it with some data. The data itself isn’t too important; we just want a table that will be updated while also concurrently be queried and then deleted. Now open a second tab and paste this next query. This one will make random changes to the queue table every… Continue reading How to update and query an SQL Queue table with multiple consumers
Here’s a link to my gist for a SQL script to return a string from bytes formatted as a larger unit. Link: https://gist.github.com/Protiguous/c40ef32ee4fa0f4e93c9413d6cc3d6bd
There’s an excellent article “How to run your CTE just once, and re-use the output” over at sqlsunday.com, but a few people on Reddit are wondering if inserting into a #temp table or @table variable would be any better [for performance]. As Brent Ozar is fond [paraphrasing!] of saying, “If you don’t know, you’re wasting your… Continue reading RE: How to run your CTE just once, and re-use the output
Update: Please try the Improved version of this script.