Tag: t-sql

Creating Dynamic Pivot Table with QUOTENAME Function

Database development, Statements, Tables

In my previous article on the basic pivot operator, we saw how pivot operator could be used to...
Read More

Methods to Rank Rows in SQL Server: ROW_NUMBER(), RANK(), DENSE_RANK() and NTILE()

Database development, Statements

SQL Server provides us with a number of window functions that help us to perform calculations across a set of rows, without the need to...
Read More

Understanding Pivot Operator in SQL

Database development, Statements

The pivot operator in SQL Server converts each row in the aggregated result set into corresponding columns in the output set. The pivot...
Read More

Counting references to a record in a table via Foreign Keys

Constraints, Database development

I have recently needed to solve the task for my own purpose: to calculate the number of external...
Read More

Introducing Common Table Expressions in SQL Server

Database development, Tables

Common Table Expressions, or CTE for short, is simply a technique to create a temporary set of records that can be referenced within an...
Read More

Introduction to Temporary Tables in SQL Server

Database development, Tables • One Comment

A temporary table in SQL Server, as the name suggests, is a database table that exists temporarily on the database server. A temporary...
Read More

Why Multiple JOINs are bad for Query or Do Not Get in the Way of Optimizer

Database administration, Performance Tuning, SQL Server

Recently, I came across an application that generated DB queries. I understand that there is...
Read More

Better ALTER than DROP

Database development, Statements

In this article, I am going to provide a construction for deleting an object before creating it....
Read More

SQL Server: The dark side of NVARCHAR

Database administration, Work with data

Introduction In this article, we are going to talk about using the nvarchar data type. We will explore how SQL Server stores this data type...
Read More

Tips for Read/Write Locks Depending on Transaction Isolation Level in MSSQL

Database administration, Security

Read Uncommitted If data is being changed in one transaction, selection of this data (in other...
Read More
Close