title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic |
---|---|---|---|---|---|---|---|---|
File Locations for SQL Server Instances |
A SQL Server instance has its own program and data files. It can share common files with other instances of SQL Server. This article includes file locations. |
rwestMSFT |
randolphwest |
mathoma |
04/07/2025 |
sql |
install |
conceptual |
[!INCLUDE SQL Server -Windows Only]
This article describes the file locations for installed components of SQL Server.
An installation of [!INCLUDE ssNoVersion] consists of one or more separate instances. An instance, whether default or named, has its own set of program and data files, as well as a set of common files shared between all instances of [!INCLUDE ssNoVersion] on the computer.
For an instance of [!INCLUDE ssNoVersion] that includes the [!INCLUDE ssDE], [!INCLUDE ssASnoversion], and [!INCLUDE ssRSnoversion], each component has a full set of data and executable files, and common files shared by all components.
To isolate install locations for each component, unique instance IDs are generated for each component within a given instance of [!INCLUDE ssNoVersion].
Program files and data files can't be installed on a removable disk drive, can't be installed on a file system that uses compression, can't be installed to a directory where system files are located, and can't be installed on shared drives on a failover cluster instance.
You might need to configure scanning software, such as antivirus and antispyware applications, to exclude SQL Server folders and file types. Review this support article for more information: Configure antivirus software to work with SQL Server.
System databases (master
, model
, msdb
, and tempdb
), and [!INCLUDE ssDE] user databases can be installed with Server Message Block (SMB) file server as a storage option. This applies to both [!INCLUDE ssNoVersion] stand-alone and [!INCLUDE ssNoVersion] failover cluster installations (FCI). For more information, see Install SQL Server with SMB fileshare storage.
Don't delete any of the following directories or their contents: Binn
, Data
, Ftdata
, HTML
, or 1033
. You can delete other directories, if necessary. However, you might not be able to retrieve any lost functionality or data without uninstalling and then reinstalling [!INCLUDE ssNoVersion]. Don't delete or modify any of the .htm
files in the HTML directory. They are required for [!INCLUDE ssNoVersion] tools to function properly.
Common files used by all instances on a single computer are installed in the folder [!INCLUDE ssinstallpath-md]. <drive> is the drive letter where components are installed. The default is usually drive C. nnn identifies the version.
The following table describes versions for the paths. {nn} is the version value used in the instance ID, and registry path.
Version | nnn | {nn} |
---|---|---|
[!INCLUDE ssqlv22] | 160 | 16 |
[!INCLUDE ssqlv15] | 150 | 15 |
[!INCLUDE ssqlv14] | 140 | 14 |
[!INCLUDE ssqlv13] | 130 | 13 |
[!INCLUDE ssqlv12] | 120 | 12 |
[!INCLUDE sssql11] | 110 | 11 |
During [!INCLUDE ssNoVersion] Setup, an instance ID is generated for each server component. The server components in this [!INCLUDE ssNoVersion] release are the [!INCLUDE ssDE], [!INCLUDE ssASnoversion], and [!INCLUDE ssRSnoversion].
The default instance ID is constructed by using the following format:
-
MSSQL for the [!INCLUDE ssDE], followed by the major version number, followed by an underscore and the minor version when applicable, and a period, followed by the instance name.
-
MSAS for [!INCLUDE ssASnoversion], followed by the major version number, followed by an underscore and the minor version when applicable, and a period, followed by the instance name.
-
MSRS for [!INCLUDE ssRSnoversion], followed by the major version number, followed by an underscore and the minor version when applicable, and a period, followed by the instance name.
Examples of default instance IDs in this release of [!INCLUDE ssNoVersion] are as follows:
-
MSSQL{nn}.MSSQLSERVER for a default instance of [!INCLUDE ssnoversion].
-
MSAS{nn}.MSSQLSERVER for a default instance of [!INCLUDE ssNoVersion] Analysis Services.
-
MSSQL{nn}.MyInstance for a named instance of [!INCLUDE ssnoversion] named "MyInstance."
The directory structure for a [!INCLUDE ssnoversion] named instance that includes the [!INCLUDE ssDE] and [!INCLUDE ssASnoversion], named "MyInstance", and installed to the default directories would be as follows:
-
C:\Program Files\Microsoft SQL Server\MSSQL{nn}.MyInstance\
-
C:\Program Files\Microsoft SQL Server\MSAS{nn}.MyInstance\
You can specify any value for the instance ID, but avoid special characters and reserved keywords.
You can specify a non-default instance ID during [!INCLUDE ssNoVersion] Setup. Instead of \{Program Files}\[!INCLUDE msCoName] [!INCLUDE ssNoVersion], a <custom path>\[!INCLUDE msCoName] [!INCLUDE ssNoVersion] is used if the user chooses to change the default installation directory. Instance IDs that begin with an underscore (_) or that contain the number sign (#) or the dollar sign ($) aren't supported.
Note
[!INCLUDE ssISnoversion] and client components aren't instance aware and, therefore aren't assigned an instance ID. By default, non-instance-aware components are installed to a single directory: [!INCLUDE ssinstallpath-md]. Changing the installation path for one shared component also changes it for the other shared components. Subsequent installations install non-instance-aware components to the same directory as the original installation.
[!INCLUDE ssNoVersion] [!INCLUDE ssASnoversion] is the only [!INCLUDE ssNoVersion] component that supports instance renaming after installation. If an instance of [!INCLUDE ssASnoversion] is renamed, the instance ID will not change. After instance renaming is complete, directories and registry keys will continue to use the instance ID created during installation.
The registry hive is created under HKLM\Software\[!INCLUDE msCoName]\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\<Instance_ID> for instance-aware components. For example,
-
HKLM\Software\[!INCLUDE msCoName]\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSSQL{nn}.MyInstance
-
HKLM\Software\[!INCLUDE msCoName]\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSAS{nn}.MyInstance
-
HKLM\Software\[!INCLUDE msCoName]\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSRS{nn}.MyInstance
The registry also maintains a mapping of instance ID to instance name. Instance ID to instance name mapping is maintained as follows:
-
[HKEY_LOCAL_MACHINE\Software\[!INCLUDE msCoName]\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\Instance Names\SQL] "<InstanceName>"="MSSQL{nn}"
-
[HKEY_LOCAL_MACHINE\Software\[!INCLUDE msCoName]\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\Instance Names\OLAP] "<InstanceName>"="MSAS{nn}"
-
[HKEY_LOCAL_MACHINE\Software\[!INCLUDE msCoName]\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\Instance Names\RS] "<InstanceName>"="MSRS{nn}"
During Setup, you can change the installation path for the following features:
The installation path is displayed in Setup only for features with a user-configurable destination folder:
Component | Default path | Configurable or fixed path |
---|---|---|
[!INCLUDE ssDE] server components | \Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSSQL{nn}.<InstanceID>\ | Configurable |
[!INCLUDE ssDE] data files | \Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSSQL{nn}.<InstanceID>\ | Configurable |
[!INCLUDE ssASnoversion] server | \Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSAS{nn}.<InstanceID>\ | Configurable |
[!INCLUDE ssASnoversion] data files | \Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSAS{nn}.<InstanceID>\ | Configurable |
[!INCLUDE ssRSnoversion] report server | \Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSRS{nn}.<InstanceID>\Reporting Services\ReportServer\Bin\ | Configurable |
[!INCLUDE ssRSnoversion] report manager | \Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSRS{nn}.<InstanceID>\Reporting Services\ReportManager\ | Fixed path |
[!INCLUDE ssISnoversion] | <Install Directory>\nnn\DTS\ 1 | Configurable |
Client components (except bcp.exe and sqlcmd.exe ) |
<Install Directory>\nnn\Tools\ 1 | Configurable |
Client components (bcp.exe and sqlcmd.exe ) |
<Install Directory>\Client SDK\ODBC\nnn\Tools\Binn | Fixed path |
Replication and server-side COM objects | [!INCLUDE ssinstallpath-md]COM\ 2 | Fixed path |
[!INCLUDE ssISnoversion] component DLLs for the Data Transformation Run-time engine, the Data Transformation Pipeline engine, and the dtexec command prompt utility | [!INCLUDE ssinstallpath-md]DTS\Binn | Fixed path |
DLLs that provide managed connection support for [!INCLUDE ssISnoversion] | [!INCLUDE ssinstallpath-md]DTS\Connections | Fixed path |
DLLs for each type of enumerator that [!INCLUDE ssISnoversion] supports | [!INCLUDE ssinstallpath-md]DTS\ForEachEnumerators | Fixed path |
[!INCLUDE ssNoVersion] Browser Service, WMI providers | [!INCLUDE ssinstallpath-md]Shared\ | Fixed path |
Components that are shared between all instances of [!INCLUDE ssNoVersion] | [!INCLUDE ssinstallpath-md]Shared\ | Fixed path |
Warning
Ensure that the \Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\ folder is protected with limited permissions.
The default drive for file locations is systemdrive, normally drive C. Installation paths for child features are determined by the installation path of the parent feature.
1 A single installation path is shared between [!INCLUDE ssISnoversion] and client components. Changing the installation path for one component also changes it for other components. Subsequent installations install components to the same location as the original installation.
2 This directory is used by all instances of [!INCLUDE ssNoVersion] on a computer. If you apply an update to any of the instances on the computer, any changes to files in this folder will affect all instances on the computer. When you add features to an existing installation, you can't change the location of a previously installed feature, nor can you specify the location for a new feature. You must either install additional features to the directories already established by Setup, or uninstall and reinstall the product.
Note
For clustered configurations, you must select a local drive that is available on every node of the cluster.
When you specify an installation path during Setup for the server components or data files, the Setup program uses the instance ID in addition to the specified location for program and data files. Setup doesn't use the instance ID for tools and other shared files. Setup also doesn't use any instance ID for the [!INCLUDE ssASnoversion] program and data files, although it does use the instance ID for the [!INCLUDE ssASnoversion] repository.
If you set an installation path for the [!INCLUDE ssDE] feature, [!INCLUDE ssNoVersion] Setup uses that path as the root directory for all instance-specific folders for that installation, including SQL Data Files. In this case, if you set the root to "C:\Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSSQL{nn}.<InstanceName>\MSSQL\", instance-specific directories are added to the end of that path.
Customers who choose to use the USESYSDB upgrade functionality in the [!INCLUDE ssNoVersion] Installation Wizard (Setup UI mode) can easily lead themselves into a situation where the product gets installed into a recursive folder structure. For example, <SQLProgramFiles>\MSSQL14\MSSQL\MSSQL10_50\MSSQL\Data\. Instead, to use the USESYSDB feature, set an installation path for the SQL Data Files feature instead of the [!INCLUDE ssDE] feature.
Note
Data files are always expected to be found in a child directory named Data. For example, specify C:\Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSSQL{nn}.<InstanceName>\ to specify the root path to the data directory of the system databases during upgrade when data files are found under C:\Program Files\[!INCLUDE msCoName] [!INCLUDE ssNoVersion]\MSSQL{nn}.<InstanceName>\MSSQL\Data.