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.

Articles

  • Temporary Tables in SQL Server 2012

    In this article, I am going to give a quick overview of temporary tables in SQL Server 2012. local temporary table, global temporary table, drop temporary table.
  • SQL Data Discovery And Classification In SSMS

    Data exploration and documentation can be cumbersome, classifying data can be one of those tedious but necessary things. With the introduction of such things as GDPR there is an ever greater need t...
  • Replace Nulls With Specified Values in SQL Server

    In this article we will see the various ways to replace null values in a table. ISNULL() function, CASE statement, COALESCE() function can be used to replace null values in a SQL Server table.
  • Difference Between Char, Nchar, Varchar and Nvarchar Data Types in SQL Server

    This small article is intended for the audience stuck in their interview when asked for the differences among CHAR, VARCHAR, NCHAR and NVARCHAR data types. CHAR vs VARCHAR, NCHAR vs NVARCHAR, diffe...
  • Understanding Transactions in SQL Server

    This article covers the fundamentals of transactions in T-SQL, from concepts such as understanding what SQL transactions are, to ACID properties, local and distributed transactions, guidelines for ...
  • New Resumable Online Index Create SQL Server 2019

    SQL Server 2019 brings a very exciting new feature that is long overdue. Resumable Online Index Create is one of my favorite new things. This, paired with the Resumable Index Rebuilds introduced wi...
  • User Defined Table Types And Table Valued Parameters

    In this article you will learn about User Defined Table Types and Table-Valued Parameters. The concepts of User-Defined Table Types (UDTTs) and Table-Valued Parameters (TVPs) were introduced in SQL...
  • 50 Important Queries In SQL Server

    In this article you will learn about 50 Important Queries in SQL Server. EXEC sp_helpdb, exec sp_helptext, EXEC sp_updatestats, EXEC sp_MSforeachtable, SQL query for version name of SQL Server, Ena...
  • Maximum Limit Value For Integer Data Type in SQL Server 2012

    In this article, I described how to calculate the maximum range of various integer data types in SQL Server. TINYINT, SMALLINT, INT and BIGINT are all number data types. The difference between thes...
  • Diving Into The Basics of SQL Server

    To learn the database, most of the times, we need to build the schema and put some data inside. But to speed up the learning and make the hands dirty in code as soon as possible, large organization...
  • Merging Data Using A Queuing Pattern

    In my recent article Using Materialized Views Effectively, I offered a few ways to populate data stores that can be critical performance-improvers for your apps and BI environments that use SQL Ser...
  • Row_Number Function in SQL Server

    This article explains the row_number function in SQL Server. Ranking functions provide a very good feature of assigning numbering to the records in the result set in SQL. Row_Number is one of these...
  • How Should We Store Images And Blob Files In SQL Server

    There is always a requirement from developers: How should I store images and BLOB files in SQL Server ? In this post let's explore the data types and methods used for storing Binary Large Objec...
  • Pivot And Unpivot In SQL Server

    In this article we will learn how to use pivot and unpivot relational operator in SQL Server.
  • Some Common Mistakes When Querying SQL Database

    When I started learning SQL, I found out several issues, which I thought to be interesting to share. For our needs, let us use AdventureWorks2012 database, which can be obtained here.
  • How To Return Boolean Values From SQL Server

    Here, I will tell you the possible ways to return calculated Boolean values from SQL Server code. At a lot of places, you want to progress conditionally. You send some input values to the stored pr...
  • Covering Indexes And Filtered Indexes In SQL

    Hello Learners. I hope you all are doing great. This article describes the Covering Indexes and Filtered Indexes. I would like to tell you that these type of Indexes can only be created as NONCLUST...
  • How Much Will Compression Really Gain Me

    Did you know that compression can gain you more than just space on a disk; it can allow you to fit more data into the buffer pool? That means queries have faster and more efficient reads which can ...
  • Merging Different Row Cells Into One In SQL

    This article is about merging different row cells into one for the purpose of reporting. Sometimes we need to customize according to the client’s requirements.
  • Updating Dynamic Columns On The Go In SQL

    I hope you all are doing fine. This particular article is about updating the dynamic columns on the go.
  • View More