Cari Blog Ini

23 Mei 2012

Create Login in SQL Server Using sp_addlogin With Default Database

Example:
Login Name : "user_test_1"
Password : "123456"
Default Database : "HRD"


1. Create New Login with Password and Default Database
-----code:start
EXEC sp_addlogin 'user_test_1', '123456', 'HRD'
-----code:end

2. Check availability of New Login
-----code:start
select loginname, dbname, [password], * from dbo.syslogins
-----code:end






Source:
http://msdn.microsoft.com/en-us/library/aa259567(SQL.80).aspx