Web Analytics Made Easy - Statcounter

What are temporal tables in SQL and how to use them for historical data tracking?

Temporal tables in SQL Server

Temporal Tables in SQL Server Temporal Tables (also known as system-versioned tables) are a feature in SQL Server. They allow automatic tracking of historical changes to data over time. They maintain a history of all changes made to a table. This makes it easy to query past versions of data. You can also analyze trends. … Read more

Best Practices in SQL Coding

Best Practices in SQL Coding

For any programming language, just writing the code is not well enough. It should be written using the best practices for getting optimise performance . In this article, I will explain the disadvantages of writing code without using Best Practices in SQL Coding. Later, I will describe how best practices can be implemented in our … Read more

Securing data in SQL Server

blank

This article explained about measures for securing data in SQL Server at various levels to protect data from unauthorized access and breaches.

Understanding CDC in SQL Server

Change Data Capture (CDC) in SQL Server

In SQL Server, Change Data Capture (CDC) is a powerful feature that tracks changes (inserts, updates, and deletes) made to tables, providing detailed information about the modifications. Introduced in SQL Server 2008, CDC is particularly useful in data warehousing, auditing, replication, and ETL (Extract, Transform, Load) scenarios, where it is crucial to maintain a historical … Read more

Advantages of SQL Stored Procedure

blank

SQL Stored procedure are the set of logically group of SQL statement which are grouped to perform a specific task. Stored procedure are better than the inline SQL queries as they help in securing the database from SQL Injection. It also help in increasing the performance of the Database. There are many other Advantages of SQL … Read more

SQL Script to find the databases size

Sometimes we need to find out the size of the database on a server. Below SQL Scripts can be used to find out the size of all the databases created on the server.  ;WITH DBSize (SqlServerInstanceName, DatabaseName, DatabaseSize, DBLogSize, TotalDBSize) AS (   SELECT      @@SERVERNAME SqlServerInstanceName,             db.name AS … Read more

T-SQL script to find the growth size of database files

Below query can be used to see the growth size of database files. DECLARE @filename NVARCHAR(1000); DECLARE @bc INT; DECLARE @ec INT; DECLARE @bfn VARCHAR(1000); DECLARE @efn VARCHAR(10); — Get the name of the current default trace SELECT @filename = CAST(value AS NVARCHAR(1000)) FROM ::fn_trace_getinfo(DEFAULT) WHERE traceid = 1 AND property = 2; — rip … Read more

How to restore database backup in SQL SERVER

blank

In this article, I am going to explain the process of  Database restoration using the SQL Server Management Studio. In this article, I will try to explain this process in a simple way so that a database developer having little knowledge of DBA can restore that database using the database backup.For database restoration process, we … Read more

How to take Database backup in SQL SERVER

blank

Introduction This article explain the simple way to take the database backup in SQL SERVER which can be easily understandable by the database programmer having little knowledge of DBA. For taking the database backup, we need to follow the given step.Step 1:- Open the SQL Sever Management Studio. For this we have to follow the following … Read more

Database Creation using SQL Sever Management Studio (SSMS)

blank

In the previous article (Database Creation using Create Database command), I explained the database creation using the Create database command. In this article, I am going to explain the steps of creation a database using SQL Sever Management Studio (SSMS) using SQL Server 2008 R2. These below database creation steps will be same for SQLServer … Read more