![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
This is a very basic question, perhaps more of a Windows XP Professional OS permissions question than a dB or programming question: how to create and access SQL SERVER databases from an account other than "Administrator"; for example, from a "Power User" account? As anything other than an "Administrator" user (i.e. as a Power User), I keep getting (when I try from inside of MS Visual Studio 2005 development environment) the error message: "CREATE DATABASE permission denied in database 'master' |
#3
| |||
| |||
|
|
raylopez99 (raylope... (AT) yahoo (DOT) com) writes: WHen you connect with some other Windows user, no get no such extra thrills, but you need to grant that login rights to do things. For instance GRANT CREATE DATABASE TO DOMAIN\PowerUser You can also add that user a role which has the privileges you want, for instance to the sysadmin role. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se |
#4
| |||
| |||
|
|
At the risk of looking even more stupid, if you know of how to "also add that user a role which has the privileges you want, for instance to the sysadmin role" within Visual Studio 2005 and/or Windows XP (for the program SQL Server 2005 Express Edition), please feel free to let me know. I just want to add the Power User to have Administrator access for the Visual Studio 2005, when working on ADO.NET (SQL Server 2005), not for all programs, if possible. For now I will simply program while logged in as an Administrator, which seems to be a good workaround to my problem. |
#5
| |||
| |||
|
|
raylopez99 (raylope... (AT) yahoo (DOT) com) writes: Do I understand this correctly that you want your user to have heavy perms when connected through VS and your application, but not when it's connected through Management Studio? There is no way you can assign permissions per application. Permissions are per logins and users. Of course, it's a legit requirement that a user should only be able to access objects in the database through the application, as the application then can control what the user can see and update. There are a couple of ways to implement this requirement. The method that has been most tested and rried is to use stored procedures. There are several ways that permissions can be granted through stored procedures, whereof the most useful is ownership chaining. If all stored procedures and tables are owned by dbo, the users only need execute permissions to the stored procedures. There are ways to handle this without stored procedures, but I am less of fond of these methods. |
#6
| |||
| |||
|
|
Thank you Erland. I see the problem is not as simple as I thought. I also see I have two problems: one is what you addressed, the other is more simple: how to use VS2005 from an account other than "Administrator" when working on databases. So far I've not been able to figure out this, and only use "Adminstrator" to code. |
#7
| |||
| |||
|
|
raylopez99 (raylope... (AT) yahoo (DOT) com) writes: Thank you Erland. I see the problem is not as simple as I thought. I also see I have two problems: one is what you addressed, the other is more simple: how to use VS2005 from an account other than "Administrator" when working on databases. So far I've not been able to figure out this, and only use "Adminstrator" to code. I did not answer that question, since I was uncertain of the scope of your question. But it's fairly simple, although there are several options. One is to enable SQL Server Authentication through Management Studio. (Right-click the server itself in the Object Explorer, select Properties and go the the Security tab. You need to restart SQL Server for the setting to take effect.) Then you can connect as sa from VS and have sysadmin rights. The good thing with this is that when you connect through your application with Windows authentication, you are a plain user and can test that you have granted that user the right permissions. |
#8
| |||
| |||
|
|
Well, turns out I don't have "Management Studio" on my system (yet strangely I was able to create a simple SQL database and run some commands). If you don't have "Management Studio" you don't have "Object Explorer", even though it's possible to have SQL Server 2005 Express (a 36.5 MB file) and not the SQL Server Management Studio Express (a 46.1 MB file) installed on your PC, as I have. Details here: http://go.microsoft.com/fwlink/?LinkId=65110 |
#9
| |||
| |||
|
|
I would definitely recommend that you download and install SQL Server Management Studio Express. In the long run it will be difficult to be without it. Particularly if you ask questions in newsgroups, because most people answering questions will assume that you have Management Studio in some form. :-) -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se |
#10
| |||
| |||
|
|
Hi Erland--it worked! Thank you very much, now I can code as a non- Administrator with no problem...except one: http://tinyurl.com/38ssp8 (a sort of bug in VS2005 doing SQL it seems) |
![]() |
| Thread Tools | |
| Display Modes | |
| |