About 7,500,000 results
Open links in new tab
  1. CREATE DATABASE (Transact-SQL) - SQL Server | Microsoft Learn

    SQL Server implements the CREATE DATABASE statement by using the following steps: The SQL Server uses a copy of the model database to initialize the database and its metadata. A service broker GUID is assigned to the database.

  2. SQL Server Create Database Examples

    Dec 11, 2019 · Let’s start with the simplest possible CREATE DATABASE statement we can do. This is simply ‘CREATE DATABASE database_name’. The following will create a database called MyDatabase with the physical files in the default file location, the login you’re using will be the owner and with all the defaults that are configured in the model database.

  3. use SQL script to create SQL server DB - Stack Overflow

    Feb 4, 2013 · Right click on a database name in the Object Explorer in SSMS, go to Tasks -> Generate Scripts for all objects. Save it to a new query window, and you can see the text necessary for creating a new database from scratch and populating it with objects (tables, SPs, etc.) Use this code to help you figure out how to generate a create string. Example:

  4. SQL CREATE DATABASE Statement - W3Schools

    The CREATE DATABASE statement is used to create a new SQL database. The following SQL statement creates a database called "testDB": Tip: Make sure you have admin privilege before creating any database. Once a database is created, you can check it in the list of databases with the following SQL command: SHOW DATABASES;

  5. T-SQL CREATE DATABASE Examples - Quackit Tutorials

    Here are various code examples for creating a database with Transact-SQL (T-SQL). The following code creates a database called Music. That is the most basic statement you can use to create a database. If you don't have any specific requirements, this code should be sufficient. However, you can modify the above code to the following:

  6. Create a SQL Server database with a script - MS DBA - SQL and IT …

    Feb 28, 2022 · To create a Microsoft database with a Transact-SQL script, use the CREATE DATABASE function as explained in this post. First, a database represents the main part of a Relational Database Management System.

  7. SQL Server Create Database CREATE DATABASE + Script

    A new database is created using the CREATE DATABASE clause. The ON PRIMARY command specifies that the data file is located in the primary Filegroup. Following that is the code section within parentheses where you define properties of the database file where data will be stored:

  8. SQL - create database and tables in one script - Stack Overflow

    Put a GO command between queries. CREATE DATABASE dbname. As for putting the table statements in the IF, you wouldn't be able to because of the GO command. You could create additional IF statements afterwards, to check for each tables pre-existence. The syntax for a …

  9. SQL Server CREATE DATABASE By Practical Examples - SQL

    This tutorial shows you how to create a new database in SQL Server using CREATE DATABASE statement or SQL Server Management Studio.

  10. SQL CREATE DATABASE | GeeksforGeeks

    Apr 12, 2025 · The CREATE DATABASE Command is used to create a new database within a SQL based Database Management System (DBMS) such as MySQL, PostgreSQL, or SQL Server. A database acts as a container where all your data tables, views, stored procedures, and more are stored. Without databases, data would have nowhere to be organized.

  11. Some results have been removed
Refresh