SQL Book

SQL Book - tutorials on SQL, Data Warehouse technologies and SQL Server

Welcome to SQL Book.

Latest SQL and Data Warehousing Articles

Why use Stored Procedures?
Using Stored Procedures gives us many benefits. In this article we will outline why we should be aiming to use Stored Procedures to enable our web and windows applications to interact with our SQL Server database.
SQL Script to automatically generate CRUD Stored Procedures
Speed up development by automatically generating commmon stored procedure definitions. The script provided in this article autogenerates Stored Procedure definitions for SELECT, INSERT, UPDATE and DELETE queries.
The SQL Outer Join - return all specified rows from one of the two tables in the join
The SQL Outer Join can be used to define a relationship between columns in two different tables and will return all rows from one of the tables whether a related record in the other table exists or not.
SQL Inner Join - examples and explanations
The SQL Inner Join statement enables us to retrieve data from two or more related tables in one SQL query.
SQL Merge - a standard SQL statement for more elegant queries
The SQL Merge statement is an official SQL standard (introduced in SQL: 2003 - the 5th version of the SQL standard) that enables UPDATE, INSERT and DELETE statements to be combined into one easy to use statement.
DDL Triggers in SQL Server - audit database objects
This article demonstrates how DDL triggers can be used to a) audit changes made to database objects using the EventData function and b) control schema changes using the ROLLBACK command.
Find out how to use the SQL DISTINCT command to return only unique rows. Article includes the syntax and real world example of it in use.
The SQL UNION command can be used to combine the output from 2 or more SELECT statements into 1 resultset. This article explains the syntax and rules of the UNION command and gives real world examples of it in use.
SQL LIKE - flexible string matching
The SQL LIKE operator is often used in the WHERE clause to find string matches on part of a column value by using a wildcard character. Article include examples, syntax and tips.
Defending against SQL Injection attacks
In this article we will look at the methods you can secure your database and front end applications to protect yourself from SQL Injection hacks.