How to delete duplicate rows from a table in SQL

Duplicate records can result in unintended outcomes when working with data. Despite data professionals disliking it, this issue is often encountered in data warehouse systems. When loading data from sources…

Read more »

Impact of using local variable in Stored Procedure

Preparing an optimal execution plan for a given SQL query is crucial, and the Query Optimizer’s ability to do so heavily relies on the accuracy and freshness of the statistics…

Read more »

How to Convert Seconds to “HH:MM:SS” format in TSQL

Presenting the time/duration in HH:MM:SS format is important for good readability. There are situations where the duration of an event needs to be calculated between time intervals. The difference can…

Read more »

Synonym in SQL Server

Synonym A synonym is an alias or an alternative name given to the other objects in the database. The alternative name can be used to refer to the underlying objects…

Read more »

Can TRUNCATE be rolled back in SQL Server?

A database transaction, by definition, must be atomic (it must either complete in its entirety or do not affect whatsoever), consistent, isolated, and durable. These four properties are commonly referred…

Read more »

How to find a column is updated.

In application development, there are situations where an action is driven based on a change in data. A trigger can be used to perform an action based on the data…

Read more »

CHECKPOINT in SQL Server

CHECKPOINT is an internal SQL Server process that runs periodically to write dirty pages (changed pages) and transaction log records from memory to disk. It then marks a point in…

Read more »

Identifying cached tables in SQL Server buffer

When a query is submitted it goes through a sequence of phases in SQL Server. Starting from parse, optimization, plan preparation until the execution of the plan. During the execution…

Read more »

When did the last statistics update occur?

Statistics are the critical piece of information that SQL Server maintains for a table or index. The query optimization process depends on the statistics information to prepare an execution plan…

Read more »

DBCC HELP!!

SQL Server has many DBCC commands, administrators use them for maintenance, validation and to collect information about the database, for example, DBCC SHOW_STATISTICS displays statistics for a table. But there…

Read more »