--- title: "CREATE DATABASE (Transact-SQL) | Microsoft Docs" description: Create database syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse ms.custom: "" ms.date: "07/03/2018" ms.prod: sql ms.prod_service: "sql-database" ms.reviewer: "" ms.suite: "sql" ms.technology: t-sql ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords: - "DATABASE_TSQL" - "DATABASE" - "CONTAINMENT_TSQL" - "CREATE DATABASE" - "CREATE_DATABASE_TSQL" - "CONTAINS_FILESTREAM_TSQL" - "CONTAINS FILESTREAM" - "CONTAINMENT" dev_langs: - "TSQL" helpviewer_keywords: - "snapshots [SQL Server database snapshots], creating" - "databases [SQL Server], creating" - "model database [SQL Server], database creation" - "mounted drives [SQL Server]" - "CREATE DATABASE" - "CREATE DATABASE statement" - "file creation [SQL Server]" - "creating databases" - "containment" - "filegroups [SQL Server], database creation" - "database creation [SQL Server], CREATE DATABASE statement" - "moving databases" - "attaching databases [SQL Server], CREATE DATABASE...FOR ATTACH" ms.assetid: 29ddac46-7a0f-4151-bd94-75c1908c89f8 caps.latest.revision: 212 author: CarlRabeler ms.author: carlrab manager: craigg monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017" --- # CREATE DATABASE Creates a new database. Click one of the following tabs for the syntax, arguments, remarks, permissions, and examples for a particular SQL version with which you are working. For more information about the syntax conventions, see [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md). # [SQL Server](#tab/sqlserver) ## Overview In SQL Server, this statement creates a new database and the files used and their filegroups. It can also be used to create a database snapshot, or attach database files to create a database from the detached files of another database. ## Syntax Create a database. ``` CREATE DATABASE database_name [ CONTAINMENT = { NONE | PARTIAL } ] [ ON [ PRIMARY ] [ ,...n ] [ , [ ,...n ] ] [ LOG ON [ ,...n ] ] ] [ COLLATE collation_name ] [ WITH