December 28, 2004 at 2:08 pm
I would like to create a user and grant this person a default database each time he/she logs in(using query analyzer).I could have probably looked on the wrong page of books online and would appreciate your help
Thanks
Michael
December 28, 2004 at 3:04 pm
--Check BOL. Use Index tab. Look for phrase
user accounts
--then choose
described
--You will find exactly what you are needing.
Michelle
December 29, 2004 at 6:42 am
To add a SQL Server login, refer to:
sp_addlogin [ @loginame = ] 'login'
[ , [ @passwd = ] 'password' ]
[ , [ @defdb = ] 'database' ]
[ , [ @deflanguage = ] 'language' ]
[ , [ @sid = ] sid ]
[ , [ @encryptopt = ] 'encryption_option' ]
To add a Windows Login (integrated security), refer to:
sp_grantlogin [@loginame =] 'login'
and
sp_defaultdb [ @loginame = ] 'login' , [ @defdb = ] 'database'
December 29, 2004 at 11:28 am
You can alos use Enterprise Manager to set the default database:
1. Expand the SQL Server Group in the left pannel.
2. Expand the Server
3. Expand Security
4. Select Logins (also in the left pannel)
5. In the right pannel, right click on the user's account and select Properties.
6. At the bottom to the Properties dialog box select the database you want the default to be.
December 29, 2004 at 11:58 am
Got the needed help .Thank you all for the great responses
Mike
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply