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.


  • How To Call A Web Service From SQL Server

    In this blog, I will explain how to call web services through a stored procedure in the SQL database.
  • How To Check A Particular Column Of A Table Update Using COLUMNS_UPDATED() In SQL Server

    In this blog, we will learn how to check if a particular column of a table is updated or not. If the column updates, the current record inserts into a trigger table using the trigger.
  • Convert Comma Separated Values To Rows And Vice Versa Using In-built And Custom SQL Code

    This blog explains the process of how to convert CSV values into row values and vice-versa, using in-built and custom SQL queries.
  • Encrypt And Decrypt Column Data In SQL Server

    Sometimes, we may want to encrypt a SQL Server column data, such as a credit card number. In this blog, let's learn how we can encrypt and decrypt SQL Server column data in the database itself.
  • Brief Introduction To Indexes In SQL Server

    Here, I will be giving a brief introduction to Indexes in SQL Server and why we need the indexing.
  • SQL Query To Calculate Age Using Given Date Of Birth (DOB)

    Date of Birth can be used to calculate the age in years, months, and days.
  • Improve SQL Query Performance

    In this blog, I will explain how to improve the performance of your SQL query. As a developer, we know any SQL query can be written in multiple ways but we should follow the best practices/techniques to achieve better query performance.
  • How To Find Employees Hired Last Month Or Year In SQL Server

    In this blog, we will understand how we can find employees hired last month or year. We will understand DATEDIFF function in SQL server. The DATEDIFF function is used to calculate the difference between two dates.
  • Different Types Of Clauses In SQL Server

    In this blog, we are going to learn about clauses in SQL Server. Clauses are used with table expressions and help in finding the result.
  • JOIN Tables Without Foreign Key In SQL Server

    In this blog, we will understand how to join two or more SQL tables without using a foreign key. We will also get an overview of Join and Keys in SQL.
  • ASCII Values Of Alphabets And Numbers In SQL Server

    In this blog, we will understand the usage of ASCII function in SQL Server and find ASCII values of capital and small alphabets.
  • Delete Duplicate Record From SQL Database Using CTE

    How to delete duplicate records from a SQL data table using CTE (common table expression). Specifies a temporary named result set, known as a common table expression (CTE).
  • Scalar Function In SQL Server

    This article demonstrates how to create and use a scalar function in the SQL Server database. In this blog, we won't go very far. We will perform only basic functions.
  • Overview Of MSSQL Logs

    Database Logs are used for any modification/transaction on table production or during development from their Database Server.
  • SQL Server ISNULL() With Multi Column Names

    Many times we come across null values within tables in SQL Server. Null values are the values with no data; that means the data is missing or unknown. In this article, initially we will understand the SQL Server IsNull function, then we will move towards extending the IsNull functionality using Coalesce function.
  • How To Rebuild Master Database In SQL Server Without Backup

    Here, we will discuss the full procedure to rebuild Master Database in SQL Server without unavailability of backup. Read the complete blog very carefully to get appropriate results.
  • Aggregate¬†Function in SQL Server

    In this blog, we will learn about aggregate function in SQL Server. An aggregate function is used to calculate the given values and returns a single value.
  • Date And Time Functions In SQL Server

    In this article we learn about Date and time functions in SQL Server.These functions are working on given date and time.These functions are SQL Pre defined functions.
  • How To Find Random Record In SQL Server

    In this blog. I will explain you how to find random record in SQL server. This is most common interview question. The CHECKSUM function returns the checksum value computed over a table row, or over an expression list. Use CHECKSUM to build hash indexes. A hash index will result if the CHECKSUM function has column arguments, and an index is built over the computed CHECKSUM value. This can be used for equality searches over the columns. SQL NEWID function is used for selecting random row from a result set in SQL Server databases. NEWID is use to assign a value to a variable declared as the uniqueidentifier data type.
  • View More