SQL Code

SQL Join Types

When pulling data from more than one table you will need to JOIN the tables together. The JOIN types will determine what records will be returned in the…


DML Triggers

There are two types of DML Triggers that can be written for each INSERT, UPDATE, or DELETE statement. Either AFTER triggers or INSTEAD OF triggers. The…


SQL Table Constraints

When creating tables you would want to use constraints to enforce data integrity. In the picture above you can see a list of the constraints…


Working with SQL Tables

In this demonstration we will be using Data Definition Language (DDL) statements to Create, Alter, and Drop a Table. The first step in creating a table…


SQL Server Categories

The Transact-SQL language is split up into four SQL Categories Data Manipulation Language (DML) – These statements allow you to manipulate the data within your tables….


Data Type Conversion

When combining Data Types it is important to note that there is a data type precedence used to determine how they are converted and combined….


Date and Time Date Types

In this demonstration we will see how to work with the various datetime data types within in SQL Server. Prior to SQL Server 2008 we…


Integer Data Types

Here is some examples of the integer data types. When deciding on a integer for a column, variable, parameter or expression it is a wise…


Character Data Types

Regular Character Data Types – Both the char and varchar data types are considered regular or non-Unicode character data types where each alphanumeric character uses…