Search code examples
sql-serversql-server-2005database-create

Creating a database in SQL Server 2005


After installing SQL Server 2005, I tried to create a new database (command: create database database_name). But the message was an error: permission denied to create a database in 'master' database. My question is 1.) how to exit this master database and create a new database outside it, 2.) what is a master database.


Solution

  • You need to Log in using sa account (system administrator), which should have all permissions. From there, you can create additional accounts as needed.

    To create a new database, the easiest way is to use SQL Server Management studio, and you can right click on "Databases" (in the left pane) and choose to create a new database.

    The "master database" just basically contains the metadata information (i.e. info about all the other DBs, etc.)