How to Find the Default File Location for Data Files and Log Files in SQL Server

By default, when we create a database on SQL Server, it consists of mdf and ldf files. When we do the default installation of these data and log files C:\Program In the Files\Microsoft SQL Server section, the file will be created according to the SQL Server version and the instance name.

The SQL Server file location is located at the Server Properties -> Database Settings -> Database Default Location.

If not specified otherwise, data and log files will be created at the specified locations when creating a new database here.

You can find the default location with the following code:

SELECT
  SERVERPROPERTY('InstanceDefaultDataPath') AS 'Data Files',
  SERVERPROPERTY('InstanceDefaultLogPath') AS 'Log Files'

Bir cevap yazın

Kişisel Web sayfama hoş geldiniz..