-
Impersonate to Create Database
Dear all,
I have sysadmin role. I am testing a Windows Logo to see if it can create database sucessfully. However, I'm getting an error saying: CREATE DATABASE permission denied in database 'master'.
Here is the scripts I ran:
USE Master;
EXECUTE AS USER = 'Domain\uid';
Create Database test;
How come I am getting permission deined? I queried the system view. This Windows logon does have permission to Create Any Database.
PS: I have issued the following statements to the server:
REVOKE CONNECT FROM GUEST;
REVOKE VIEW ANY DATABASE FROM public;
Does the error has something to do with these Revoke statements?
Thank you!
-
What kind of sql permission does that windows accoung have? Is it in any server role?
-
Database creation is a server level permission, so you have to impersonate the login and not the database (master) user.
EXECUTE AS LOGIN = 'Domain\uid';
--HTH--
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|