Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the diffrence between sp_addlogin and sp_adduser ?

1,193 views
Skip to first unread message

Courtney Anthony

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
I am looking at the stored procedures script for sp_addlogin and sp_adduser
from Sybase SqlAnywhere and I am not sure of the diffrernce between them.
Both procedures requires almost the same paramaters.
If I use both proceduers do I achieve the same end result ?
Can anyone tell me the difference between the two procedures?

Sybase SQl Anywhere 5.5.04 Build # 1867
PB 5 and PB 6.5
OS Windows 98

Jim Egan

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
For ASE there is a difference between a user and a login. But for ASA
there is no difference so those two should do essentially the same thing.
--
Jim Egan [TeamSybase]
Houston, TX
http://www.eganomics.com

Sybase Developers Network
http://sdn.sybase.com/sdn/mec/mec_home.stm

Viktor Kollarik

unread,
Sep 27, 2000, 3:00:00 AM9/27/00
to
As Jim stated, on ASE using sp_addlogin you create a server login and using
sp_adduser
you create database user with responding server login.
In ASA when you create a database user he is standardly (unless his
password is NULL) allowed to login.
Original SQL syntax of creating users on ASA is;
GRANT CONNECT TO <username> IDENTIFIED BY <password>

Viktor Kollarik

Jim Egan <dba...@eganomics.com> wrote in message
news:MPG.143b2cf7d...@199.93.177.77...

Courtney Anthony

unread,
Sep 27, 2000, 3:00:00 AM9/27/00
to
The problem I am experiencing is that sp_addlogin puts the user to default
group while sp_adduser puts the user to the group you name in the parameter.
What I have done is use the sp_adduser to add the user then sp_adduser to
add to the group where user_name = login_name so that I can add the user to
the selected group of my choice. I am not able to do that from sp_addlogin.
The problem with this approach is that after I have called the sp_addlogin
then sp_adduser the last stored procedure set the password to null.

I would like to add the user to a specific group -- I have created four
groups with different privaledges
Jim and VictorThanks for the help!!
"Viktor Kollarik" <ko...@gmx.net> wrote in message
news:mPaOGdG...@forums.sybase.com...

Jim Egan

unread,
Sep 27, 2000, 3:00:00 AM9/27/00
to
I don't use the ASE system procedures for adding logins/users. I use the
GRANT statement. That way I always know what is going to happen. The
way the GRANT works should be more consistent than a stored procedure
which is more likely to change from version to version.

Viktor Kollarik

unread,
Sep 28, 2000, 3:00:00 AM9/28/00
to
Hi Courtney,

Jim is right, ASE-like system procedures are just for Sybase-wide
compatibility. This sequence could help you do what you need:

GRANT CONNECT TO <username>

GRANT MEMBERSHIP IN GROUP <groupname> TO <username>

Hope this helps,

Viktor Kollarik

Jim Egan <dba...@eganomics.com> wrote in message

news:MPG.143c6fa6b...@199.93.177.77...

Courtney Anthony

unread,
Sep 29, 2000, 3:00:00 AM9/29/00
to
Thanks
This squence works just fine for me

"Viktor Kollarik" <ko...@gmx.net> wrote in message
news:QQRLMtS...@forums.sybase.com...
0 new messages