I am unable to create a database in SQL Server 2008. This is the message that I recieve every time:
TITLE: Microsoft SQL Server Management Studio ------------------------------ Create failed for Database 'university'. (Microsoft.SqlServer.Smo) ------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=262&LinkId=20476
What should be done?
This is related to the permission of the logged in user.
Solution 1)
Click on Start -> Click in Microsoft SQL Server 2005
Now right click on SQL Server Management Studio
Click on Run as administrator
Solution2)
check with
select user_name()if you are not logged in as guest.Add a domain account as sysadmin to SQL Express with SQLCMD
check if the login is created successfully
Grant sysadmin rights
Reference : http://blogs.msdn.com/b/dparys/archive/2009/09/17/create-database-permission-denied-in-database-master-my-fix.aspx