How to add Data or Log Files to a Database in SQL Server

In this article, we will see how to add Data or Log Files to a Database in SQL Server step by step.

Permissions required:

Requires ALTER permission on the database.

Limitations and Restrictions

1. We cannot add or remove a file while a BACKUP statement is running.
2. A maximum of 32,767 files and 32,767 filegroups can be specified for each database.

Method1: Using SQL Server Management Studio
1. Connect to SQL Server Instance and expand Databases, right-click the database from which to add the files, and then click Properties.
Continue reading How to add Data or Log Files to a Database in SQL Server

How to change default data file and transaction log files location in SQL Server

In this article, we will see how to change default data file and transaction log files location in SQL Server.

By default database files are stored in DATA folder of respective instance.
It is always best practice to to maintain data and transaction log files in different disks in order to get the following advantages:

1. Minimize data loss.
2. High Performance.
3. To avoid disk space regular issues.
4. To avoid page corruption issues.

Best Practices:
Continue reading How to change default data file and transaction log files location in SQL Server