Save C# DataTable to Sql Server Table

Introduction

In this article, I would like to explain the fastest way to save c# data table into sql server table using user defined table type.

👉 Download project from : 

🎞 video tutorial :

Basics

I have created a demo table product.

Save c# datatable to sql server table Continue reading “Save C# DataTable to Sql Server Table”

Joins in Sql Server

Introduction

This is an article about joins in sql server . The article covers all aspects of joins using proper examples and Venn diagrams.

What is meant by joins in SQL server ?

Joins are the commands used to combine data from two or more tables based on relation between them. The relation between them is specified using columns from each tables and relational operators like  =,<,> and <>.

General Syntax : –

Continue reading “Joins in Sql Server”

Delete Vs Truncate in SQL Server

Introduction

This article is about comparing  delete Vs truncate in SQL server, It is one of the most discussed topic on all SQL server forums, So there is no point in just discussing their basic difference, this article will be an elaborate one with supporting explanations.

Both delete and truncate command is used to for removing records from tables, the main difference between them lies in the way they perform this operation.

Delete Vs Truncate

Difference between delete and truncate can be summarized as below

Delete Truncate
Command Type DML DDL
Where Condition support does not support
Reset Identity Column no yes
Acquired lock row lock table and page lock
Transaction log for each deleted row one log indicating deallocation of page
Performance(Speed of execution)  slow much faster than Delete

Continue reading “Delete Vs Truncate in SQL Server”

Delete Duplicate Rows in Sql Server

Article will cover some best practices on how to delete duplicate rows from sql server table.

We’ll be using a student table. Query for the table creation

Continue reading “Delete Duplicate Rows in Sql Server”