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 DATABASEscript 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
- 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.
- Look at the file clause for that logical name. In a
CREATE DATABASEstatement, every file listed in theFILESsection must have aNAMEand aFILENAME. For any file other than the primary data file, SQL Server also requires explicitSIZE,MAXSIZE, andFILEGROWTHvalues. If you copied a script and trimmed one of those, that is the cause. - 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 leastNAMEandFILENAME; the log file needsNAMEandFILENAMEand is usually givenSIZE,MAXSIZE, andFILEGROWTHas well. - Check for a file entry you did not intend. Sometimes a trailing comma or a copied block leaves a bare
(NAME = N'...')with noFILENAME. Delete that entry or complete it. A file with only a name and no filename will trigger 1036. - Verify the paths exist and are writable. The folder in
FILENAMEmust already exist; SQL Server does not create directories. Confirm the service account (for exampleNT 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. - 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.
- 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. - 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
SIZEon 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
FILENAMEpath 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) withFILENAME(the physical path). Both are required. - Forgetting that the log file is declared after
LOG ONand must also haveNAMEandFILENAME. - Assuming error 1036 is a permissions or corruption issue. It is a statement-shape error; check the syntax first.
Tips
- Write the
CREATE DATABASEscript by hand or generate it from a working database rather than hand-editing a half-remembered snippet. - Keep
SIZE,MAXSIZE, andFILEGROWTHconsistent across data files so growth is predictable. - Use
MAXSIZE = UNLIMITEDonly 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.