Sybase Groups

Sybase Groups are used to grant the list of permissions for the members. We can create the group with specific permission on a table, view, or procedure. Then, we will the users to that particular table. Groups defined in one database are applicable for other databases. For example, if we create a group for xyz database then, the same group is not applicable other groups on ASE server.

1) Create a table:

create table k2sch(name varchar(50), tech varchar(50))
go

insert into k2sch values(‘George White’, ‘Sybase’)
go

2) Creating group: Creating group for select statements on k2sch table

sp_addgroup k2sch_read_only
go

3) Now grant the select permission to k2sch_read_only group.

grant select on k2sch to k2sch_read_only
go

Now we added the select permission for the group k2sch_read_only.

4) Adding users to the above group. To add any user to a group, the user must have access to the current database

sp_changegroup k2sch_read_only, anil
go

5) To check the users in group

sp_helpgroup k2sch_read_only
go

6) To remove a user from the group:

sp_changegroup “public”, anil
go

7) Drop a group

sp_dropgroup k2sch_read_only
go

Powered by k2schools