How to Avoid Using C drive for Database Create in SQL Server - SQL Server DBA Tutorial

In this video you will learn how to avoid using C drive as SQL Server Database data or/and log files. It also explains what are the drawbacks of using C:\ drive as SQL Server database data drive or log drive. You will learn how to look at SQL Server database settings and how to change default database data and log file location. Video explains step by step process of changing SQL Server Database settings along with pre-requisites of these changes to be in effect.

Script used in the video To avoid C drive for database create in SQL Server

USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData', REG_SZ, N'D:\Data'
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog', REG_SZ, N'L:\Data'
GO


Avoid Using C drive for Database Create in SQL Server - DBA Tutorial