cancel
Showing results for 
Search instead for 
Did you mean: 

SAP ASE create new user with read permissions for entire database

former_member195792
Participant
0 Kudos

Hi,

I was wondering if there is a simple command to create a new user for our DEV database, who will only have read permissions?

I created a user test, in the DEV database.But now I want to give it read access to the entire DEC database.
In the documentaton I can only find how to give the permission per table, but not for the entire database.

Best regards,

Menno

Accepted Solutions (1)

Accepted Solutions (1)

former_member187136
Contributor
0 Kudos
former_member195792
Participant
0 Kudos

Hi Kiran,

Thank you for your reply.
I do not want to "copy"a user, but give a newly created user READ access to a database (SAP database).

Im afraid if I use sp_addalias the new user will have more then just READ access, which is not allowed in the company.

Regards,

Menno

former_member187136
Contributor
0 Kudos

HI Menno,

Try this below query may be this will help.

select 'grant select on ' + name + ' to <user_name>' from sysobjects where type = 'U' or type = 'P'

go

select 'grant update on ' + name + ' to <user_name>' from sysobjects where type = 'U' or type = 'P'

go

select 'grant execute on ' + name + ' to <user_name>' from sysobjects where type = 'U' or type = 'P'

go

select 'grant all on ' + name + ' to <user_name>' from sysobjects where type = 'U' or type = 'P'

go

U - User Objects, P - Stored Procedures

Regards

Kiran K Adharapuram

former_member195792
Participant
0 Kudos

Many thanks Kiran,

This was exactly what I was looking for !

Best regards,

Menno

former_member187136
Contributor
0 Kudos

Dear Menno,

Sorry for the confusion.

Glad that you can now able to grant permission of all the tables & Stored Procedures

Regards

Kiran K Adharapuram

Answers (1)

Answers (1)

former_member187136
Contributor
0 Kudos

Menno,

There is a stored procedure called sp_addalias whcich allows an Adaptive Server user to be known in a database as another user.

Example:

There is a user named “albert” in the database’s sysusers table and a login for a user named “victoria” in master.dbo.syslogins. This command allows “victoria” to use the current database by assuming the name “albert”:

sp_addalias victoria, albert

Regards

Kiran K Adharapuram