Category Archives: Handling SQL tables

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

By | 18. 12. 2019

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 TRUNCATE TABLE Command – Don’t use DELETE when you don’t have to

By | 13. 12. 2019

T-SQL TRUNCATE command deletes all records in the table. Apart from DELETE (more in article SQL DELETE) command, there is no possibility to filter which record to delete. It is all or nothing. Truncate is on the other hand much faster compared to DELETE since it writes less into transaction log. TRUNCATE Syntax TRUNCATE TABLE dbo.Table;… Read More »

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

By | 1. 11. 2019

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 fixedly choose (INSERT INTO … VALUES (value1, value2, …)) You can insert the values into the table using script (SELECT… Read More »