Category Archives: Database

Updating a table using a join in SQL Server (UPDATE FROM)

Yes, this is most probably trivial to everybody except me. For whatever reason, I simply don’t remember this syntax. Every time I have to do this, I Google it and usually end up on this solution. You can go there … Continue reading

Posted in Database, SQL | Tagged , , | Leave a comment

T-SQL to get the counts of records within age ranges

This post is written just in case future me has to do this again… I was emailed a spread sheet containing thousands of birth dates by my boss, and asked to return a segregation based on the number of them … Continue reading

Posted in Database | Tagged | Leave a comment

A SQL helper class that allows executing a query or running a stored procedure, with or without dynamic parameters

A while back I wrote about my extension method to copy a non-generic collection to an array. A commenter pointed out that it isn’t really necessary. Oh well… here is some code that uses it… (If you use this code, … Continue reading

Posted in Database, SQL | Tagged , | 1 Comment

I hate SQL. One way of doing a subquery in a JOIN statement

I really do. I’m writing this mostly for myself because I never remember this shit. I wrote this query  now but I know that I won’t remember how to do this in future, so here is the public note to … Continue reading

Posted in Database, SQL | Tagged | 1 Comment

Two ways to change the default backup directory for SQL Server

This has driven me nuts for years. I always change the default data directory in SQL Server Management Studio. That’s easy to do and the feature to do so is easily discoverable. Just right-click the server instance in the Object … Continue reading

Posted in Database, Work | Tagged , | Leave a comment