-
Adding users to SQL-Server
Our product uses MSDE or MS-SQL Server 2K. It does not use SQL logins - it is strictly NT logins. Our product DB has a Users table that contains all the NT logins that have permission to use the product.
I have written a stored procedure that grants new users permission to the SQL-Server, grants them permissions to the DB, adds them to a role (to grant them permission to the objects they'll need) and then adds them to the product's Users table. I use the sp_GrantLogin and sp_GrantDBAccess stored procedures to perform those first two steps.
The problem occurs if the user already has permissions to the SQL-Server or the DB because of an alias, or because they are members of a group that has permissions (such as the local Administrators group). The two stored procedures above will throw an error if this occurs. However, the result is only pass/fail (0 or 1), so I can't tell programmatically if the failure is due to the user already being in the system (due to an alias) or for some other reason.
How can I test (using SQL Script) to see if an NT Login already has permissions to the server and to a particular DB?
Thanks...
Bob Rouse
Dimension Data
-
Let me simplify the question...
When executing "sp_GrantLogin", I get an error: "The login already has an account under a different user name"
How can I find out what that other user name is?
Thanks,
Bob Rouse
Dimension Data
Similar Threads
-
By rperez in forum Database
Replies: 5
Last Post: 01-02-2009, 04:14 PM
-
By Dan Staggs in forum Careers
Replies: 0
Last Post: 08-07-2002, 11:04 AM
-
By Levi Nkata in forum Database
Replies: 3
Last Post: 04-11-2001, 09:31 AM
-
By David Hay in forum Database
Replies: 2
Last Post: 04-02-2001, 07:11 PM
-
By sb in forum VB Classic
Replies: 2
Last Post: 08-31-2000, 10:34 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks