Categories
Sql Server

How many types of files in sql server

Sql server mainly consist of three types of files:-

  1. Primary File :- The primary data file contains the startup information for the database and points to the other files in the database. User data and all objects can be stored in this file or in secondary data files. Every database has one primary data file. The recommended file name extension for primary data files is .mdf. There can only be one primary data file.
  2. Secondary File :- Secondary data files are optional, user-defined, data files. Secondary files can be used to spread data across multiple disks on your server by putting each file on a different disk drive. Additionally, if a database exceeds the maximum size for a single Windows file, you can use secondary data files so the database can continue to grow. The  extension for secondary data files is .ndf.
  3. Transction Log File :- Log files hold all the log information that can be used to recover the database.There must be at least one log file for each database. The recommended extension for log files is .ldf.