

The recommended file name extension for secondary data files is. The log holds information used to recover the database. There must be at least one log file for each database. The recommended file name extension for transaction logs is. ldf.įor example, a simple database named Sales has one primary file that contains all data and objects and a log file that contains the transaction log information. A more complex database named Orders can be created that includes one primary file and five secondary files. The data and objects within the database spread across all six files, and the four log files contain the transaction log information.īy default, the data and transaction logs are put on the same drive and path to handle single-disk systems. This choice may not be optimal for production environments. SQL Server files have two file name types: We recommend that you put data and log files on separate disks. Logical_file_name: The logical_file_name is the name used to refer to the physical file in all Transact-SQL statements.

The logical file name must comply with the rules for SQL Server identifiers and must be unique among logical file names in the database. Os_file_name: The os_file_name is the name of the physical file including the directory path. It must follow the rules for the operating system file names.įor more information on the NAME and FILENAME argument, see ALTER DATABASE File and Filegroup Options (Transact-SQL). Read/write data filegroups and log files are not supported on an NTFS compressed file system. Only read-only databases and read-only secondary filegroups are allowed to be put on an NTFS compressed file system.įor space savings, it is highly recommended to use data compression instead of file system compression.
