How to login to database in Sybase

Creating login with sp_addlogin means just added login in Adaptive server. Nothing can be done with adding login. We can login into the Adaptive server and even we cant access the default database mentioned at the time of login creation.

To access the database objects, update, delete the any data, we have to add user in the database using sp_adduser procedure.

Syntax:

sp_adduser loginame [, name_in_db [, grpname]]

Where
grpname is the group name existed in the current database.
If you we dont specify the group name, it adds to public group by default.

Examples:

Add user created in Sybase logins creation to k2schools database and add user readonly group.

use k2schools
go
sp_adduser k2admin,k2admin, readonly
go

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by k2schools