Category Archives: Handling SQL tables

In this category I included articles that deal with table operations (DDL and DML operations), such as Create, Insert, Update, Merge, truncate, etc.

Don’t miss out from category:

SQL ALTER TABLE – Syntax, Add, Change Data Type, Delete Column

The ALTER TABLE statement, along with commands like CREATE TABLE, belongs to the category of Data Definition Language (DDL) commands. It allows us to modify the definition of a table. Changes to an SQL Server table can include: Adding a new column Deleting a column Changing the data type or definition of a column Changing… Read More »

SQL DELETE TABLE Statement, Difference DELETE and TRUNCATE, Deleting Large Amounts Of Data

We distinguish two types of commands with data deleting purpose – SQL commands DELETE and TRUNCATE. Each is suitable for different situations. It is good to know them both and be able to choose the right one in a specific situation. DELETE Syntax (First Command is Optional): DELETE FROM dbo.Table WHERE <Condition>; or DELETE dbo.Table WHERE… Read More »

SQL CREATE TABLE- How to Create a Database Table (SQL Server)

Creating a table in the SQL Server database is a basic skill. While creating it using SQL command CREATE TABLE we define: Name of the table together with database definition and scheme List of the columns with appropriate data types, constraints and definition if the column can be empty (NULL vs. NOT NULL) Table can… Read More »

SQL MERGE Statement – INSERT, UPDATE, DELETE at once

SQL MERGE command is an advanced way of comparing data in two tables (Source and Destination). We compare records and based on match (or difference) we execute UPDATE, INSERT or DELETE according to the result of the table comparison. We will use this mainly with data sync between objects/systems or with ETL processes in environments… Read More »

SQL INSERT – Inserting Rows into Database Table (3 methods) + Common mistakes

SQL Command INSERT is suitable for situations when we want to insert entries into the table. Insertion of rows can be done in multiple ways (further description below): You can insert the values that you choose (INSERT INTO … VALUES (value1, value2, …)) You can insert the values into the table using script (SELECT clause… Read More »