Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create new database in SQL SERVER 2019

Status
Not open for further replies.

CodeFart

Technical User
Feb 10, 2021
1
US
I am using a new virtual server on premise, SQL SERVER 2019.
I was able to install and connect to Sql Server Mgmt Studio with Windows Auth.
I have gone through the simple steps to create a New Database. R click on Databases and choose New Database.
Every time, I get that I do not have the permission to create in master. Then I tried model. Still no permissions.
I've been through a number of possible solutions by searching online.

Can anyone tell me what I am doing wrong?
Thanks.
 
 https://files.engineering.com/getfile.aspx?folder=d0e21829-06a5-4c46-a967-ed9242f3279e&file=create_database_error.PNG
first - you do not connect to SSMS - SSMS is your client to connect to your SQL Server.

your SQL Server is on prem so your local DBA's/System Administrators would have granted you access to the server with a particular set of permissions.
By default if you are not part of the DBA team you will not have permissions to create new databases and normally you would ask them to do it for you.

If your DBA team and your manager agree to give you access to create databases on that particular server then your DBA's will need to give you a particular set of permissions - or a way to create databases that does not require you to have the required permissions.


Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
You don't create a database "in master", master is a database about all databases of the server instance and as Frederico explained, you obviously need permissions so these meta data informatios can be added to master. But on the front of creating a new database, you mainly create a new MDF and LDF file.

If you ask me issuing CREATE DATABASE can be easier than using the visual database creation, as its options are not as straightforward. I suggest you read about CREATE DATABASE and all its options as a command and use that to create your database on the instance:
Notice everything besides the database name is optional. So you could first start with
CREATE DATABASAE YourDB

The defaults for recovery mode, etc. are okay and can also be altered later by ALTER DATABASE.

Or - much simpler - if you're actually not a DBA leave this job for the DBA team. Database creation is just a one time job. Afterwards, you just need to have the dbo (database owner) role to create the actual tables, views, stored procs, etc.



Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top