Mafiree logo
  • About
  • Services
  • Blogs
  • Careers
  • Products
    • orbit logo Orbit
    • streamer logo Xstreami
  • Contact
Schedule a Call
Menu
  • About
  • Services
  • Blogs
  • Careers
  • Products
    • orbit logo Orbit
    • streamer logo Xstreami
  • Contact
  • Schedule a Call
Database
Database Database Managed Services
MySQL MySQL
MySQL Consulting Services
MySQL Migration Services
MySQL Optimization & Query Tuning
MySQL Database Administration
MySQL Backup & Recovery
MySQL Security & Maintenance
MySQL Cloud Services (AWS RDS, Aurora, Google Cloud SQL, Azure)
MySQL for Ecommerce
MySQL High Availability & Replication
MongoDB MongoDB
MongoDB Consulting Services
MongoDB Migration Services
MongoDB Optimization & Query Tuning
MongoDB Database Administration
MongoDB Backup & Recovery
MongoDB Security & Maintenance
MongoDB Cloud (Atlas)
MongoDB Solutions by Industry
MongoDB High Availability & Replication
PostgreSQL PostgreSQL
PostgreSQL Consulting
PostgreSQL Migration & Upgrades
Performance Tuning & Query Optimization
PostgreSQL Administration & Managed Services
High Availability, Clustering & Replication
PostgreSQL Backup, Recovery & Disaster Planning
PostgreSQL Security, Compliance & Auditing
PostgreSQL for Analytics & Data Warehousing
PostgreSQL on Cloud & Containers
PostgreSQL Extensions & Open-Source Integrations
PostgreSQL for Every Industry
SQL Server MSSQL
MSSQL Consulting Services
MSSQL Migration Services
MSSQL Optimization & Query Tuning Services
MSSQL Database Administration Services
MSSQL Backup & Recovery Services
MSSQL High Availability & Replication Services
MSSQL Security & Compliance Services
MSSQL Performance Monitoring & Health Checks
MSSQL Solutions by Industry
Aerospike Aerospike
Aerospike Consulting Services
Aerospike Migration Services
Aerospike Performance Optimization & Tuning
Aerospike Database Administration
Aerospike Backup & Recovery
Aerospike High Availability
Aerospike Cloud & Hybrid Deployments
Aerospike for Real-Time Applications (AdTech, FinTech, Retail, IoT)
Analytics DB
Analytics DB Analytics DB Services
Clickhouse Clickhouse
ClickHouse Consulting Services
ClickHouse Migration Services
ClickHouse Optimization & Query Tuning
ClickHouse Database Administration
ClickHouse Backup & Recovery
ClickHouse Security & Maintenance
ClickHouse Cloud Services (ClickHouse Cloud, AWS, GCP, Azure)
ClickHouse Solutions by Industry
ClickHouse High Availability & Replication
TiDB TiDB
TiDB Consulting & Architecture Planning
TiDB Administration & Maintenance
TiDB Security and Privacy Maintenance
TiDB Performance & Query Optimization
TiDB Migration Services
TiDB Backup & Disaster Recovery
TiDB High Availability Solutions
TiDB Solutions by Industry
TiDB Cloud Services
ScyllaDB ScyllaDB
ScyllaDB Consulting & Architecture Planning
ScyllaDB Administration & Maintenance
ScyllaDB Security and Privacy Maintenance
ScyllaDB Performance & Query Optimization
ScyllaDB Migration Services
ScyllaDB Backup & Disaster Recovery
ScyllaDB High Availability Solutions
ScyllaDB Solutions by Industry
ScyllaDB Cloud Services
DevOps
DevOps DevOps Services
Version Control Version Control
Kubernetes Kubernetes
Infrastructure Infrastructure Management
Web Servers Web Servers
Networking
Networking Networking Services
Basic Basic
Advanced Advanced
MySQL MySQL
MongoDB MongoDB
PostgreSQL PostgreSQL
MSSQL MSSQL
Aerospike Aerospike
Clickhouse Clickhouse
TiDB TiDB
ScyllaDB ScyllaDB
Version Control Version Control
Kubernetes Kubernetes
Infrastructure Infrastructure Management
Web Servers Web Servers
Basic Basic
Advanced Advanced
MySQL Consulting Services
MySQL Migration Services
MySQL Optimization & Query Tuning
MySQL Database Administration
MySQL Backup & Recovery
MySQL Security & Maintenance
MySQL Cloud Services (AWS RDS, Aurora, Google Cloud SQL, Azure)
MySQL for Ecommerce
MySQL High Availability & Replication
MongoDB Consulting Services
MongoDB Migration Services
MongoDB Optimization & Query Tuning
MongoDB Database Administration
MongoDB Backup & Recovery
MongoDB Security & Maintenance
MongoDB Cloud (Atlas)
MongoDB Solutions by Industry
MongoDB High Availability & Replication
PostgreSQL Consulting
PostgreSQL Migration & Upgrades
Performance Tuning & Query Optimization
PostgreSQL Administration & Managed Services
High Availability, Clustering & Replication
PostgreSQL Backup, Recovery & Disaster Planning
PostgreSQL Security, Compliance & Auditing
PostgreSQL for Analytics & Data Warehousing
PostgreSQL on Cloud & Containers
PostgreSQL Extensions & Open-Source Integrations
PostgreSQL for Every Industry
MSSQL Consulting Services
MSSQL Migration Services
MSSQL Optimization & Query Tuning Services
MSSQL Database Administration Services
MSSQL Backup & Recovery Services
MSSQL High Availability & Replication Services
MSSQL Security & Compliance Services
MSSQL Performance Monitoring & Health Checks
MSSQL Solutions by Industry
Aerospike Consulting Services
Aerospike Migration Services
Aerospike Performance Optimization & Tuning
Aerospike Database Administration
Aerospike Backup & Recovery
Aerospike High Availability
Aerospike Cloud & Hybrid Deployments
Aerospike for Real-Time Applications (AdTech, FinTech, Retail, IoT)
ClickHouse Consulting Services
ClickHouse Migration Services
ClickHouse Optimization & Query Tuning
ClickHouse Database Administration
ClickHouse Backup & Recovery
ClickHouse Security & Maintenance
ClickHouse Cloud Services (ClickHouse Cloud, AWS, GCP, Azure)
ClickHouse Solutions by Industry
ClickHouse High Availability & Replication
TiDB Consulting & Architecture Planning
TiDB Administration & Maintenance
TiDB Security and Privacy Maintenance
TiDB Performance & Query Optimization
TiDB Migration Services
TiDB Backup & Disaster Recovery
TiDB High Availability Solutions
TiDB Solutions by Industry
TiDB Cloud Services
ScyllaDB Consulting & Architecture Planning
ScyllaDB Administration & Maintenance
ScyllaDB Security and Privacy Maintenance
ScyllaDB Performance & Query Optimization
ScyllaDB Migration Services
ScyllaDB Backup & Disaster Recovery
ScyllaDB High Availability Solutions
ScyllaDB Solutions by Industry
ScyllaDB Cloud Services
  1. Home
  2. > Blogs
  3. > SQL Server
  4. > How MS SQL Server Manages Data at Rest and Data in Motion

How MS SQL Server Manages Data at Rest and Data in Motion

Data at Rest refers to inactive data stored in databases, while Data in Motion is actively transmitted or processed between systems in SQL Server.

SivaTarun March 17, 2025

Subscribe for email updates

Overview: 

 

  • Why data security is crucial
  • Data at Rest
  • Data in Motion
  • Conclusion

Why data security is crucial: 
 

In today's digital age, data is one of the most valuable assets for any organization. It exists in two main states: data at rest and data in motion. Protecting both is crucial for maintaining security and compliance in an ever-evolving cyber landscape. This blog explores the differences between these two data states, how to protect them, and their importance in SQL Server environments.

 

Data at rest:
 

Data at rest refers to data that is stored and not actively moving through networks or systems. This includes databases, backups, files stored on disk drives, and cloud storage. Because this data is not in transit, it is typically static, making it an attractive target for unauthorized access or theft.

For Example:

  • Database files (.mdf, .ldf, .ndf).
  • Backup files.
  • Files stored on hard drives, servers, or cloud services.

SQL provided TDE(Transparent Data Encryption) is a way to protect the data at rest.

About TDE: 

  • To help secure a user database, you can take precautions like:
    • Designing a Secure System.
    • Encrypting confidential assets.
    • Building a firewall around the database servers.
  • One solution is to encrypt sensitive data in a database and use a certificate to protect the keys that encrypt the data. This solution prevents anyone without the keys from using the data.
  • TDE isn't available for system databases.

Configuring TDE: 

 

Step 1: Create a master key in master database.

USE master;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '#hdhd@jkd';  
GO

You can check if the key successfully in below query.

SELECT name, symmetric_key_id, algorithm_desc, create_date
FROM sys.symmetric_keys 
WHERE symmetric_key_id = 101

Step 2: Create a certificate which protected by the master key.

USE master;
GO
CREATE CERTIFICATE CertforTDETest
WITH SUBJECT = 'Certificate for TDE'
START_DATE = '20240125'
EXPIRY_DATE = '20250125';  
GO

Step 3: Create a database encryption key which protected by the certificate.

USE DEMO;
GO
CREATE DATABASE ENCRYPTION KEY  
WITH ALGORITHM = AES_256 
ENCRYPTION BY SERVER CERTIFICATE CertForTDETest;  
GO

Step 4: Enable transparent data encryption for particular database.

ALTER DATABASE DEMO 
SET ENCRYPTION ON;  
GO

Step 5: You can check the TDE status of the database using below query.

SELECT 
d.name,
d.is_encrypted,
dek.encryption_state,
dek.percent_complete,
dek.key_algorithm,
dek.key_length
FROM
sys.databases as d
INNER JOIN sys.dm_database_encryption_keys AS dek
ON d.database_id = dek.database_id

Note: Also we can check the encryption status from database properties through SSMS as well. 

 

Tried to take backup and restore in another instance . But facing the below error due to encryption. 
 

 

To restore the database to another server, you need to create encryption on that server with the same password. 
 

Data in motion: 

 

Data in motion refers to data actively being transferred between systems, networks, or applications. This state occurs when data is being accessed, queried, or transmitted from one location to another over a network, such as when users query SQL Server databases remotely or transfer backups to a cloud storage service.
 

For Example: 

 

  • Queries sent from an application to a database.
  • Data replication between servers.
  • Backups transferred to offsite storage.
  • API calls that access data remotely.

SQL provided SSL/TLS to protect the data in motion. (Secure Sockets Layer/Transport Layer Security).

 

About TLS/SSL:
 

  • TLS: Encrypts data transmitted between SQL Server and client applications. SQL Server supports TLS 1.0, 1.1, and 1.2 on both Windows and Linux.
  • SSL: Discontinued in SQL Server 2016 (13.x).
  • TLS is the successor to SSL and fixes the security flaws in the older technology. SSL was replaced in 2015 after being compromised by vulnerabilities.
  • The most commonly used versions of TLS are TLS 1.0, TLS 1.1, TLS 1.2, and TLS 1.3. TLS 1.3 is the latest version and offers the most robust encryption. 

Configuring TLS/SSL: 

Generate a self-signed certificate with PowerShell.

Now the Thumbprint is generated.

 

Step 1: Once you have the installed the certificate, you need to bind it to the SQL Server instance, so open the SQL Server Configuration Manager.

Step 2: Click SQL Server Network Configuration, right-click Protocols for your instance, and select Properties from the context menu, as shown in the following screenshot.

 

Step 3: Click the Certificate tab, and choose the TLS certificate you installed from the dropdown list.

 

Step 4: Now click the Flags tab, select Yes under the Force Encryption field, and click OK. If you skip this step, the SQL Server will allow both encrypted and unencrypted connections from clients.

 

Step 5: Click OK to confirm.


Note: Any changes will not apply until you will take a service restart.

 

Step 6: Then, we need to export and import the certificate. Click Start > Run, enter certlm.msc, and right-click the certificate on under personal folder. Select All Tasks > Export.

 

Step 7: The below page will open, Select the first option and click next.



 

Step 8: Then give the password and click next.

 

Step 9: Browse the file and give the name of the file. Then click Next.

Step 10:  Then click next and  the file was succesfully exported.
 

Step 11: Once the certificate exported, then expand the Trusted Root Certification Authorities > right click the Certificate > All Tasks > import.

 

Step 12: Then select the files > click next. 

 

Step 13: Give the password >click next>finish, your certificate was successfully imported.

 

Step 14: Now to connect the server in SSMS and now check all incoming connections to the server are encrypted.


Conclusion: 

 

Protecting data is crucial for every organization. Data at rest needs strong encryption and secure storage to prevent unauthorized access, while data in transit must be protected with secure transmission methods like SSL/TLS. By securing data in both states, businesses can reduce risks, comply with regulations, and build trust with their users. Simple and effective security measures make a big difference in keeping sensitive information safe.

Leave a Comment

Related Blogs

How to Optimize SQL Server Performance: Implementing Online DDL

SQL Server 2022 added the "Wait at Low Priority" option that allows index creation and alteration to wait for resources to become available before executing.

  2653 views
Resumable Operations for ALTER TABLE Constraints in SQL Server 2022

Empower Your Database Management with SQL Server 2022's Resumable Operations

  1901 views
Data File Splitting in SQL Server

Huge data blocks resides under single MDF file might cause a performance of the query and impact the application services. This blog help you to understand how we can the split the single MDF file into multiple data files.

  1525 views
SQL Server On Linux

SQL Server 2017 brings the best features of the Microsoft relational database engine to the enterprise Linux ecosystem, including SQL Server Agent, Azure Active Directory (Azure AD) authentication, best-in-class high availability/ disaster recovery, and unparalleled data security.

  2217 views
Achieving High Availability Using Log Shipping

Here we will get the detailed explanation of how we can achieve HA using Log Shipping.

  2794 views

Subscribe for email updates

Get in touch with us

Highlights

More than 6000 Servers Monitored

Happy Clients

Certified DBAs

24 x 7 x 365 Support

PCI

Database Services

MySQL MongoDB PostgreSQL SQL Server Aerospike Clickhouse TiDB MariaDB Columnstore

Quick Links

Careers Blog Contact Privacy Policy Disclaimer Policy

Contacts

Linkedin Mafiree Facebook Mafiree Twitter Mafiree

Nagercoil Office

Miru IT Park, Vallankumaranvillai,

Nagercoil, Tamilnadu - 629 002.

Bangalore Office

Unit 303, Vanguard Rise,

5th Main, Konena Agrahara,

Old Airport Road, Bangalore - 560 017.

Call: +91 6383016411

Email: sales@mafiree.com


Copyright © - All Rights Reserved - Mafiree