user2793239
user2793239

Reputation: 21

How to create a new database in SQL Server 2005?

I installed "SQL Server 2005 Express Edition" and "SQL Server Management Studio Express" on a Windows 7 Box.

When I try to create a new database in Management Studio I get this error message:

Create failed for Database 'MyDatabase'.  (Microsoft.SqlServer.Express.Smo)

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. 
(Microsoft.SqlServer.Express.ConnectionInfo)

CREATE DATABASE permission denied in database 'master'. 
(Microsoft SQL Server, Error: 262)

How do I create a new database in SQL Server 2005?

Upvotes: 0

Views: 10026

Answers (2)

sqlint
sqlint

Reputation: 1089

Right click SQL Management studio icon and run it as administrator. If you are a member of sysadmin group then you should be able to right click "Databases" folder and choose "New Database", then follow onscreen instructions.

Upvotes: 0

Eric Leschinski
Eric Leschinski

Reputation: 153822

Create a new database in SQL Server 2005:

Start SQL Server Management Studio as administrator by right clicking the icon and choosing "run as administrator".

Connect to the database engine with username/password.

Right click the folder that says: "Databases", and choose "New Database", see the following screenshot:

enter image description here

You get this screen, enter your database name of 'foobar'.

enter image description here

Click OK. Now look under databases folder to see your new foobar database:

enter image description here

Upvotes: 1

Related Questions