February 11, 2016 : 27 SQL Performance Tuning Techniques

This article presents 27 SQL performance tuning tips. The impact of each of these tips depends on: which DBMS you are using. how you organised your data. what is your current hardware configuration. the volume of data present in your … Continue reading

May 10, 2015 : SQL Server: send mails based on a table.

The following code sample shows how to send a mail to clients based on a client table. This sample is using a loop. You should avoid using a loop in your scripts. Try first to execute your task using an … Continue reading

April 19, 2015 : SQL server script to insert test data massively

This article shows how to insert a massive amount of data in your tables. You will learn how to write SQL server scripts to: insert data in a loop. improve the performance of the insertion. This is done by inserting … Continue reading

March 24, 2015 : Create Random Data with SQL Server

This article will show you how to create data randomly. You will learn how to: create a random number between x and y. create a random date. create a random letter. create a random word. pick a random element from … Continue reading

February 24, 2015 : Triggers in SQL server

A trigger waits that a user does an action on a database. When it happens, the trigger launches a group of actions. Example: a trigger waits that a user updates a row in the table clients. When this happens, the … Continue reading

February 15, 2015 : Use stored procedures with SQL server

A stored procedure executes one or more SQL statements. In order to use a stored procedure: you create a stored procedure containing the SQL statement(s). The DBMS will store it (them) in the database. When a program needs to execute … Continue reading

November 30, 2014 : SQL Server Installation (free version)

Microsoft SQL Server is a relational database management system (RDBMS). If you want to learn how to work with it, you can install Microsoft SQL Server Express on your computer. SQL Server Express is the free version of SQL Server. … Continue reading

November 21, 2014 : Database Normalisation

Define your priorities When designing a database, you need to choose which information goes in which table. Base your choice on your priorities: your priority is to retrieve data as fast as possible. or your priority is to save disk … Continue reading

October 28, 2014 : Format your query results with SQL functions

This lesson shows how to format the results of your query: show a value depending on a condition with “select case”. show a part of a string with “mid”. convert results with “cast”. concatenate strings with “concat” or “+”. take … Continue reading

October 20, 2014 : Combine Update and Delete with Subqueries in SQL

This post will show you how to: update a row in a table with a where condition that uses another table. delete a row with a where condition that uses another table. Test data: We are going to use the … Continue reading