SQL Server error 1036 means a CREATE DATABASE statement is missing a required file option — almost always the SIZE, MAXSIZE, or FILEGROWTH clause on a secondary file, or a missing NAME/FILENAME for a file that is not the primary data file. The fix is to supply the missing option in the CREATE DATABASE statement (or remove the stray file entry). You do not need to reinstall anything; the error is purely a syntax problem in your T-SQL.

What You'll Need

  • SQL Server Management Studio (SSMS) or Azure Data Studio connected to the instance, with permission to create databases (dbcreator or sysadmin).
  • The exact CREATE DATABASE script you are trying to run, so you can inspect the file clauses.
  • Knowledge of the folder path where the data and log files should live, and that the SQL Server service account can write to it.

Step-by-Step

  1. Reproduce the error and read the full message. Run the failing statement in a query window. Error 1036 typically reads “File option is required in this CREATE statement” and points to the file entry that is incomplete. Note which file (logical name) is mentioned.
  2. Look at the file clause for that logical name. In a CREATE DATABASE statement, every file listed in the FILES section must have a NAME and a FILENAME. For any file other than the primary data file, SQL Server also requires explicit SIZE, MAXSIZE, and FILEGROWTH values. If you copied a script and trimmed one of those, that is the cause.
  3. Add the missing options. For example, a secondary data file entry should look like:
    (
      NAME = N'SalesData2',
      FILENAME = N'C:\SQLData\SalesData2.ndf',
      SIZE = 512MB,
      MAXSIZE = UNLIMITED,
      FILEGROWTH = 256MB
    )
    The primary file needs at least NAME and FILENAME; the log file needs NAME and FILENAME and is usually given SIZE, MAXSIZE, and FILEGROWTH as well.
  4. Check for a file entry you did not intend. Sometimes a trailing comma or a copied block leaves a bare (NAME = N'...') with no FILENAME. Delete that entry or complete it. A file with only a name and no filename will trigger 1036.
  5. Verify the paths exist and are writable. The folder in FILENAME must already exist; SQL Server does not create directories. Confirm the service account (for example NT Service\MSSQLSERVER) has write permission on the folder. A path problem usually produces a different error, but fixing it now avoids a second failure after the syntax is corrected.
  6. Run the corrected statement. Execute it in a new query window. If it succeeds, the database appears in Object Explorer under Databases. If you still get 1036, compare your statement against the template in the next step.
  7. Use a known-good template. A minimal working statement is:
    CREATE DATABASE SalesDB
    ON PRIMARY
    (
      NAME = N'SalesDB',
      FILENAME = N'C:\SQLData\SalesDB.mdf',
      SIZE = 512MB,
      MAXSIZE = UNLIMITED,
      FILEGROWTH = 256MB
    ),
    (
      NAME = N'SalesDB_Data2',
      FILENAME = N'C:\SQLData\SalesDB_Data2.ndf',
      SIZE = 512MB,
      MAXSIZE = UNLIMITED,
      FILEGROWTH = 256MB
    )
    LOG ON
    (
      NAME = N'SalesDB_log',
      FILENAME = N'C:\SQLData\SalesDB_log.ldf',
      SIZE = 256MB,
      MAXSIZE = 2GB,
      FILEGROWTH = 128MB
    );
    Adapt names and paths; keep every option present.
  8. If you are using the SSMS graphical designer, the same rule applies behind the scenes. In the New Database dialog, add files on the Files page and fill in Initial Size, Autogrowth, and Path for each one. Leaving a row blank in the grid can generate a script that fails with 1036. Click Script before executing to inspect the generated T-SQL.

Common Mistakes

  • Omitting SIZE on a secondary file because “SQL Server will pick a default.” It will not for non-primary files; the option is mandatory.
  • Leaving a trailing comma after the last file entry, which can leave an empty or malformed clause.
  • Using a FILENAME path on a drive that does not exist on the server, or a UNC path the service account cannot reach.
  • Mixing up NAME (the logical name used inside SQL Server) with FILENAME (the physical path). Both are required.
  • Forgetting that the log file is declared after LOG ON and must also have NAME and FILENAME.
  • Assuming error 1036 is a permissions or corruption issue. It is a statement-shape error; check the syntax first.

Tips

  • Write the CREATE DATABASE script by hand or generate it from a working database rather than hand-editing a half-remembered snippet.
  • Keep SIZE, MAXSIZE, and FILEGROWTH consistent across data files so growth is predictable.
  • Use MAXSIZE = UNLIMITED only when the disk has room; otherwise set a cap to avoid filling the volume.
  • Store data and log files on separate volumes where possible; it is a standard layout and makes the script easier to review.
  • Test the script on a development instance before running it on production.

Troubleshooting

If the statement still fails with 1036 after adding the options, copy the exact statement into a text editor and check each file block one by one for a missing NAME, FILENAME, SIZE, MAXSIZE, or FILEGROWTH. Look for a file entry that appears twice or a block that was pasted without its opening parenthesis. If the error changes to a path or permission error, the syntax is now correct and the remaining problem is filesystem access — confirm the folder exists and the SQL Server service account can write to it. If you are scripting from the SSMS designer, regenerate the script and compare it with your hand-written version. If the database name already exists, drop it first or choose another name; that produces a different error, but it is a common next stumble. When in doubt, run the minimal template above with your paths substituted, then add extra files one at a time.

Frequently Asked Questions

What causes SQL Server error 1036?

A CREATE DATABASE statement lists a file without the options SQL Server requires — typically a non-primary file missing SIZE, MAXSIZE, or FILEGROWTH, or any file missing NAME or FILENAME.

Does error 1036 mean my database is corrupted?

No. It is a syntax error raised before any files are created. Nothing is written, so there is no corruption to repair.

Can I create a database without specifying file options?

Only for the simplest form where SQL Server supplies defaults for the primary data and log files. As soon as you add a secondary file or specify a file list, the options become mandatory.

Why does the SSMS designer produce a script that fails with 1036?

If a row in the Files grid is left with blank size or autogrowth values, the generated T-SQL can omit a required option. Fill every column or remove the row, then use Script to review before executing.

Is error 1036 the same on all SQL Server versions?

The message wording can differ slightly by version and language, but the cause and fix are the same: complete the file options in the statement.