Sybase Logins Creation

Sybase logins are used to access the Adaptive Server. We can create the logins using either sp_addlogin procedure or create login ddl command.

Sybase Login Syntax1:

sp_addlogin loginame, passwd [, defdb]
[, deflanguage] [, fullname] [, passwdexp]
[, minpwdlen] [, maxfailedlogins]


Parameter Description
loginame is the new login name to be created
passwd password for the new login
defdb is the default database assigned to user when logs into Adaptive Server.
deflanguage default language when user logged into the Adaptive server
fullname is name of the login who owns the login. Mention this quotation marks.
passwdexp Password expiration in number of days
minpwdlen Specify the password length between 0 and 30 characters
maxfailedlogins to allow maximum failed logins. After specified number of failed logins, account will be locked.


create login login_name with [encrypted]
password password

Important points:

  • Only a System Security Officer can execute sp_addlogin.
  • System administrator or database owner can add user to database or to a group.
  • System administrator can grant roles to user.
  • System administrator or database owner or Object owner can grant permissions to users on objects.
  • login,passwd are mandatory parameters to create login with sp_addlogin procedure. For remaining parameters mention null.
  • Password must be at least 6 characters length.
  • It is recommended to specify the login must be same as operating system login.
  • Logins information is stored in syslogins table of master database.


Sybase login creation with name k2admin,password as k2admin@123, default database as k2schools,full name as

sp_addlogin k2admin,k2admin@123,k2schools,null,’’

Sybase Logins Creation

To get information about login create use the sp_displaylogin procedure.

sp_displaylogin k2admin


Suid: 3
Loginame: k2admin
Default Database: k2schools
Default Language:
Auto Login Script:
Configured Authorization:
Locked: NO
Date of Last Password Change: Aug 16 2014 5:16AM
Password expiration interval: 0
Password expired: NO
Minimum password length: 6
Maximum failed logins: 0
Current failed login attempts: 0
Authenticate with: AUTH_DEFAULT
Login Password Encryption: SHA-256
Last login date:
Exempt inactive lock: 0

Powered by k2schools