SQL Server
Welcome to SQL Server section of C# Corner. In this section, you will find various SQL Server related source code samples, articles, tutorials, and tips.


  • Suvendu Shekhar Giri

    Transact SQL Code Snippets

    A Transact-SQL code snippet is a template containing the basic structure of a Transact-SQL statement or block. You can use snippets as a starting point when adding statements in the Database Engine...
  • sagar shinde

    Computed Columns In SQL Server

    This article will help the user to write a complex calculation in the backend (SQL SERVER). A computed column is computed from an expression that can use other columns in the same table.
    sagar shinde Nov 07, 2017
  • Morteza Mousavi

    SQL UNION Operator

    The SQL UNION operator combines two or more SELECT statements.
    Morteza Mousavi Oct 13, 2017
  • Nikunj Satasiya

    Write And Execute Dynamic SQL Query In SQL Server

    This example demonstrates how to write and execute dynamic SQL Query in SQL Server. You can execute the Query using EXEC sql command and sp_executesql commands in SQL Server.
    Nikunj Satasiya Sep 28, 2017
  • Talaviya Bhavdip

    How To Find Which Table Record Count Increases Or Decreases In SQL Server

    In this blog, the user can find out in which table records are deleted or inserted.
    Talaviya Bhavdip Sep 26, 2017
  • Hamid Khan

    ACID Properties In SQL

    ACID properties are atomicity, consistency, isolation, and durability.
    Hamid Khan Sep 18, 2017
  • Saravanan Ponnusamy

    Different Ways To Use GETDATE() Function In SQL Server 2008 R2

    This blog will list different ways to use GETDATE() funtion in SQL Server 2008 R2. The major changes in the new SQL Server 2008 are the DateTime function and the introduction of new data types.
  • Anil Avula

    SQL Server Setup Or Installation Failure Errors

    SQL Server 2008 R2 setup failed with “Error 1406. Could not write value to key \SOFTWARE. System error. Verify that you have sufficient access to that key, or contact your support personnel”.
    Anil Avula Sep 06, 2017
  • Nisarg Upadhyay

    Parameter Sniffing In SQL Server

    SQL Server uses a process called parameter sniffing when it executes a stored procedure that has parameters. When the procedure is compile or recompiled, the value passed in the parameter is evalua...
    Nisarg Upadhyay Aug 23, 2017
  • Junaid Syed

    Merging Table Data Using Merging Statement In MSSQL 2012

    In this blog, we will learn how we can merge the table data using merging statement.
    Junaid Syed Aug 23, 2017
  • Anil Jha

    Select All Columns From A Table Except One Column

    Usually, we use * to select all the columns but if we have to select all the columns except one column, then we have to write all the required columns one by one. Here I am going to show how we can...
    Anil Jha Aug 09, 2017
  • Anoop Kumar Sharma

    Setup AdventureWorks Database In Microsoft SQL Server 2014

    In this blog, we will learn how to setup AdventureWorks Database in Microsoft SQL Server 2014.
    Anoop Kumar Sharma Aug 08, 2017
  • Jothish Kumar

    Password Encryption And Decryption In SQL SP

    In this blog, I have explained the process involved in the password security using Encryption and Decryption in SQL Stored Procedure.
    Jothish Kumar Aug 08, 2017
  • suhas Dingankar

    What Is Normalization?

    Normaliztion is the process of arranging and managing data
    suhas Dingankar Aug 01, 2017
  • Nisarg Upadhyay

    SQL Script To Insert Images, Document In Table

    This script will perform bulk insert of images, documents in table.
    Nisarg Upadhyay Jul 30, 2017
  • Ravi Kiran Chanduri

    Bitwise Operators In SQL

    Bitwise operators in SQL server. Bitwise AND (&) and Bitwise Exclusive OR(^)(Caret symbol use in MS SQL server)
  • Ajeet  Malviya

    Delete Duplicate Rows In SQL

    The delete query should delete all duplicate rows except one. The output should be as shown below, after the delete query is executed.
    Ajeet Malviya Jul 25, 2017
  • Anil Jha

    Rename Table And Column Name In SQL Server 2014

    Most of the time, if we have to rename a table or rename a column, we usually drop table and create table again, but with this approach we lose data. This approach may work in a development environ...
    Anil Jha Jul 14, 2017
  • Saravanan V

    The What, When, and How of Indexed Views

    This blogs talks about Indexed Views in SQL Server and the pros and cons of using them.
    Saravanan V Jul 06, 2017
  • Nisarg Upadhyay

    Generate Table Definition In SQL Server Without GUI

    This script will create table definition along with unique key, primary key and indexes.
    Nisarg Upadhyay Jul 04, 2017