How to set database in single user mode on SQL Server

In this article, we will see how to set database in single user mode on SQL Server by using GUI method and SQL Statement.

Why single user mode?
1. Database Single-user mode specifies that only one user at a time can access the database and is generally used for maintenance tasks.

2. If other users are connected to the database at the time that we want set the database to single-user mode, their connections to the database will be closed without warning.

Permissions Required to set single user for database in SQL Server:
Continue reading How to set database in single user mode on SQL Server

How to rename a database in SQL Server

In this article, we will see how to rename a database in SQL Server by using QL Server Management Studio or Transact-SQL.

1. Renaming system databases are not allowed.
2. It is best practice to set a database in single user mode to close any open connections.
3. User must be granted ALTER permission on the database which is going to be renamed.

Rename database in SQL Server using SQL Server Management Studio:
Continue reading How to rename 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