Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can not add user

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hi

I am success with add login for a user (using sp_addlogin), but I am unable to add the user name (using sp_adduser). I log in as 'sa' and already check sp_helpuser if there is any same user name, but there is not. Here is the error.

1> sp_dropuser test
2> go
Msg 17232, Level 16, State 1:
Procedure 'sp_dropuser', Line 100:
No user with the specified name exists in the current database.
(return status = 1)
1> sp_adduser test, Read_Write_Selected_Objects
2> go
Msg 17330, Level 16, State 1:
Procedure 'sp_adduser', Line 178:
A user with the same name already exists in the database.
(return status = 1)

any idea why?

thanks
 
Odd. One thing to check is aliases. You might have a login test that's been aliased to another user name, but sp_helpuser should show this.

If you have access to Sybase Central, it makes user manipulations a lot easier.

One final thing, before you use sp_adduser, you must be in the DB you want to work in (not in master). So, just to be sure you haven't landed in master by accident, do a USE <dbname> statement before you run sp_helpuser.

HTH,

John J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net
 
Thanks Craig

I find out my problem.
There is a user name called &quot;Read_Write_Selected_Objects&quot;, and as the matter of fact that I am adding the same username but not adding the user &quot;test&quot; as I want.

I means the command should be:
> sp_adduser test, test, Read_Write_Selected_Objects

but I missed the username, and as the result, the system reports that there is already that user name exist and won't allow me to add another one with the same name.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top