SQL Server - sp_adduser
Asked By AdamSanke
24-Jan-08 11:17 AM
Hi,
I have 3 instances of SQL2K running in a clustered environment. If I log in
to a database as a member of the group db_owner and thenI run sp_adduser, it
fail's saying I do not have sufficient permissions to run that procedure.
However if I run sp_grantdbaccess it works fine. Why is this?
If I change the user to be the dbo (sp_changedbowner) then sp_adduser works
fine. Can anybody explain this to me please?
Thanks
Adam
SQL Server
(1)
Clustered
(1)
Bit
(1)
Database
(1)
Nevarez
(1)
Linchi
(1)
Sankey
(1)
Grantdbaccess
(1)
Tibor Karaszi replied...
Seems to be by design. my Cut&Paste doesn't work from the VM where I run SQL2K. But check BOL for
both sp_adduser and sp_grantdbaccess. See Permissions section for each and you will see that this is
by design.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
BenNevare replied...
Hi Adam,
According to BOL sp_adduser is included for backward compatibility only, so
you should use sp_grantdbaccess instead.
Regarding the permissions every entry on BOL has a Permissions section
almost at the end and in this case the permissions are a little bit different
for these two T-SQL statements.
Hope this helps,
Ben Nevarez
LinchiShe replied...
Adam;
If you run sp_helptext 'sp_adduser' and sp_helptext 'sp_grantdbaccess', and
compare how each does its permission checks, you'll find that sp_adduser
checks for is_member('dbo'), whereas sp_grantdbaccess checks for
is_member('db_owner').
A user that is not dbo, but a member of db_owner fixed role, will fail
is_member('dbo') check, thus the situation you ran into.
Linchi
Cannot restart SQL Server service SQL Server I recently installed SQL Server 2008 Express Edition with Advanced Tools. This is the version information from SQL Server Management Studio Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709- 1414 ) Microsoft
MSDE on Windows 2003 R2 box, new DL385G6 - Install Fails during SQL Services SQL Server I have been finding that I am having trouble with the Crystal Reports Server XI installation failing when it is dealing with SQL. So, as a thought and in case there was something wrong with my SQL portion of the isntall. I thought ok, I will try installing the actual MSDE application direct from Microsoft. So, I downloaded the MSDE for SQL 2000 (which is msde2000a.exe), set my switches and off to the races. It quit seconds left to the installation and bombed with the same errors as the Crystal Reports Server install. The error is the same whether I try to install MSDE by itself or
Why_can’t_recursive_queries_contain. . .? SQL Server hi I hope I didn = 92t put too many questions 1) Why can = 92t recursive queries also be unioned together with UNION operator ( instead they must use UNION ALL )? thanx SQL Server Programming Discussions SQL Server 2008 (1) SQL Server 2005 (1) SQL Server 2000 (1) SQL Server (1) Oracle (1) Ruby (1) MichaelcoAToptonlineDOTnet (1
SQL Express: Failed Reinstall SQL Server Dear Setup Experts: I am trying to reinstall SQL Express after playing with it some. I uninstalled it, and now, it refuses to reinstall in the face. Any ideas what this log file means and how I can get SQL Express installed? I really do not want to have to reinstall my whole system. * ** ** Start of Log File Overall summary: Final result: SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup. Exit code (Decimal): -2068643839 Exit facility code: 1203
Access 2007-> SQL Server2005 "connection was forcibly closed", GNE 1 SQL Server SQL, Server2005, "connection, was, forcibly, closed", GNE, 1" / > Hi, with an Access 2007 application, I have a very big problem connecting an SQL Server 2005. The scenario: - nearly 200 clients with Windows XP Professional (in an Active Directory Domain clients uses WAN, LAN and WLAN, different locations - one SQL Server 2005 EE, uses actually 36 databases, the Access 2007 application uses 2 of them (one