Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Small problem

Author  Topic 

DaDukeee
Starting Member

4 Posts

Posted - 2011-05-20 : 15:28:06
Hello all I have a small problem,I am using SQL server management studio express I connect to a database engine and when I try to create a new database I get an error: Create database permission denied in database 'master'. microsoft sql server error 262.I am using win 7 and a have a user called Duke with administrator rights.Please help me out,thank you.

X002548
Not Just a Number

15586 Posts

Posted - 2011-05-20 : 16:16:10
are you using the GUI or are you writing code?



USE [master]
GO

IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'blddistm')
BEGIN

ALTER DATABASE [blddistm] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DROP DATABASE [blddistm]

END
GO


/****** Object: Database [blddistm] Script Date: 12/23/2008 08:35:29 ******/
CREATE DATABASE [blddistm] ON PRIMARY
( NAME = N'blddistm_Data', FILENAME = N'D:\Database\PAERSCBVD0402\Default\blddistm.MDF' , SIZE = 20480KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
LOG ON
( NAME = N'blddistm_Log', FILENAME = N'D:\Database\PAERSCBVD0402\Default\blddistm.LDF' , SIZE = 76736KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO
EXEC dbo.sp_dbcmptlevel @dbname=N'blddistm', @new_cmptlevel=80
GO
ALTER DATABASE [blddistm] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [blddistm] SET ANSI_NULLS OFF
GO
ALTER DATABASE [blddistm] SET ANSI_PADDING OFF
GO
ALTER DATABASE [blddistm] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [blddistm] SET ARITHABORT OFF
GO
ALTER DATABASE [blddistm] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [blddistm] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [blddistm] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [blddistm] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [blddistm] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [blddistm] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [blddistm] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [blddistm] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [blddistm] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [blddistm] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [blddistm] SET READ_WRITE
GO
ALTER DATABASE [blddistm] SET RECOVERY FULL
GO
ALTER DATABASE [blddistm] SET MULTI_USER
GO
ALTER DATABASE [blddistm] SET TORN_PAGE_DETECTION ON
GO

ALTER DATABASE [blddistm] SET READ_WRITE
ALTER DATABASE [blddistm] SET MULTI_USER
GO




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

DaDukeee
Starting Member

4 Posts

Posted - 2011-05-20 : 16:40:14
I am using the GUI and the sequence of code you wrote is not helping.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-05-20 : 16:45:57
quote:
Originally posted by DaDukeee

I am using the GUI and the sequence of code you wrote is not helping.



why not? did you cut, paste and modify the code in an SSMS Query window?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

DaDukeee
Starting Member

4 Posts

Posted - 2011-05-20 : 17:09:29
I get this when I execute:

Msg 262, Level 14, State 1, Line 4
CREATE DATABASE permission denied in database 'master'.
Msg 15010, Level 16, State 1, Procedure sp_dbcmptlevel, Line 47
The database 'blddistm' does not exist. Supply a valid database name. To see available databases, use sys.databases.

Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 2
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 2
ALTER DATABASE statement failed.
Msg 5011, Level 14, State 5, Line 3
User does not have permission to alter database 'blddistm', or the database does not exist.
Msg 5069, Level 16, State 1, Line 3
ALTER DATABASE statement failed.

but by real problem is that even if i run the smallest of sequences i get this: CREATE DATABASE permission denied in database 'master'.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-05-21 : 05:52:23
Maybe this helps:
http://www.sqlservercurry.com/2008/04/resolving-create-database-permission.html


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

DaDukeee
Starting Member

4 Posts

Posted - 2011-05-21 : 07:14:24
Thank you so much yes that did the trick
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-05-21 : 07:43:29
I'm glad it works now


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -