SQL Code

Working with Schemas

In a previous post we discussed the four part name of a SQL Server object in 2005 and later that included the SCHEMA as part of…


SQL Four Part Names

As part of the T-SQL naming convention in SQL Server every object (Table, View, etc…) has a four part name used to reference that object….


SQL Query Processing

This post will describe how a SQL Server will PROCESS a query. The first time through running an Ad Hoc query or Stored Procedure, SQL…


SQL COALESCE Function

The goal of this demonstration is to use the COALESCE function to find the annual salary of each employee. The first section of code is creating a table…


The Output Clause

When you run Data Manipulation Language (DML) statements such as an INSERT, UPDATE, or DELETE, in most cases you will receive a message similar to…


Delete vs Truncate vs Drop

One of the questions I get frequently is what is the difference between using DELETE versus using TRUNCATE versus using DROP when working with data…


IDENTITY Columns

In this demonstration we will be showing how to use IDENTITY columns in a table. First of all, an IDENTITY field is very similar to an…


Using the INSERT statement

For this demonstration we will use the HR.Employees table that we created in the post on Table Constraints. We will begin with just a simple INSERT statement that…


Data Manipulation Language (DML)

For this demonstration on Data Manipulation Languare (DML) statements we will create a table named dbo.TestTable with four columns. Then we will be using the INSERT statement to add…