March 25, 2002 at 2:25 am
Hi,
I need to create a login that refers to 2 databases, but I have to use a script. I use
"EXEC sp_addlogin 'Cris' , 'Cris', 'MyDB', 'us_english'"
So, I want this login to point also to 'HisDB'.
How can I do this with T-SQL?
Thanks
March 25, 2002 at 4:24 am
You can use sp_grantdbaccess procedure.
1) Login as sa or dbo
2) USE HisDB
3) EXEC sp_grantdbaccess 'Cris', 'Cris'
Thanks
Regards
Ram
March 25, 2002 at 5:18 am
SP_grantdbaccess is the preferred method. If you look at sp_addlogin it just in turn calls sp_grantdbaccess.
Andy
March 25, 2002 at 9:34 am
Thank you for your answers. I solved my problem with sp_grantdbaccess.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply