Common Table Expressions Can Be A Good Thing

Most of our coding these days has Common Table Expressions, also known as CTEs. If not, you’re either working on an older version of SQL Server or you haven’t been introduced to this piece of goodness. CTEs can make reading SQL queries a lot easier if the logic is convoluted. For example, let’s use the…… Continue reading Common Table Expressions Can Be A Good Thing

Transactions should (never) be distributed

For the last few blog posts, we’ve been talking about transactions. If you’ve missed any, be sure to click on the links below: Using Save Points with Transactions to Get BetterHow about we TRY and CATCH some Transactions?Setting up a Friendly TRANSACTION In the version of transactions that we going to discuss today, we’re going…… Continue reading Transactions should (never) be distributed

Using Save Points with Transactions to Get Better

When we last conversed, we talked about the TRY/CATCH block and how it works with transactions. If you somehow missed that, you can read about it here – How about we TRY and CATCH some Transactions? We’ll wait for you… All right, now that everyone’s back with us, we’ll talk more about everyone’s favorite -…… Continue reading Using Save Points with Transactions to Get Better

How about we TRY and CATCH some Transactions?

In our last post, we started talking about transactions and how they can help your databases have data integrity. Let’s continue that today with our friends TRY and CATCH. TRY is just telling SQL Server that we want to try out something. CATCH tells SQL Server what to do if it completely messes up. BEGIN…… Continue reading How about we TRY and CATCH some Transactions?

How to Define objects

In my last post, I discussed some of the DML commands in SQL Server. This week I want to discuss another category of commands – Data Definition Language, or DDL. DDL is used to define or redefine the structure of the database. The commands that are used for DDL are as follows: CREATEDROP ALTERRENAMETRUNCATE So…… Continue reading How to Define objects