SQL Server – Restricted User on Local Database

sql server

I started working at a new job and when I opened up SSMS and tried connecting to my local DB (by connecting to ".") I got a cannot connect message.

I was finally able to connect to my local DB by connecting to ".\SQLEXPRESS"

The problem I am having now is that I am not able to create any databases, tables etc on my local DB. I get the CREATE DATABASE permission denied in database 'master'

I also tried running the Activity monitor as a test and received the error message "The user does not have permission to perform this action. (Microsoft SQL Server, Error: 297).

I am wondering if this has anything to do with the fact that I am not an "Administrator" on my computer or if it is just the way SQL Server was installed.

When I go into Security > Logins I see BUILTIN\Users and sa (which has a little red arrow pointing down next to it)

When I double click on the sa Login it shows that there is a pasdword for the SA account.

Does this mean that whoever installed SQL Server on my machine created an sa user during installation with a password which is why I have no permissions??

Best Answer

If the instance name is .\SQLEXPRESS you have an instance of SQL Server Express but not localdb.

The default install will give builtin\administrators permissions on the database so you will have to start the Managment Studio (SSMS) by right clicking the shortcut and select run as admin to have an administrative token and be able to create databases.

When running the SSMS as admin you can add your user account to the sysadmin role in the database server and after that run things using your user account without elevation.