Create new database sql server

Here are the steps to create a new database in SQL Server:

Step 1: Open SQL Server Management Studio

Step 2: Connect to the Server

Step 3: Create a New Database

SQL Script

If you prefer to create a database using a SQL script, you can use the following script:

CREATE DATABASE MyNewDatabase
ON (NAME = 'MyNewDatabase', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\MyNewDatabase.mdf', SIZE = 1024MB, MAXSIZE = 2048MB, FILEGROWTH = 10%)
LOG ON (NAME = 'MyNewDatabase_log', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\MyNewDatabase_log.ldf', SIZE = 256MB, MAXSIZE = 512MB, FILEGROWTH = 10%)

Replace the file paths and sizes with your own values.

Verify the Database

Once the database is created, you can verify it by expanding the "Databases" folder in the Object Explorer and checking that your new database is listed.

That's it! You have now created a new database in SQL Server.