Friday, February 24, 2012

Help with Login / User problem

I am newbe to MS SqlServer, and can`t find out how to do create a Login/User
so when I am log on Windows network as a given user and then connect to an
instance of SqlServer, I am connected to a specific database as a specific
user.
Example of what I`m trying to do:
- Windows network domain : Milestone
- Domain user : BBP
- SqlServer registration name : MTN002
- Database name (on MTN002) : Milestone_TEST
-- SqlServer user I wish to be: : Kuku
When I log on to network domain Milestone as user BBP, start SQL Query
Analyzer and run the query "SELECT USER", I want to see the result "Kuku".
Somehow I cant get it done. What do I miss ?
TIA
Boaz Ben-Porat
Milestone Systems> When I log on to network domain Milestone as user BBP, start SQL Query
> Analyzer and run the query "SELECT USER", I want to see the result "Kuku".
> Somehow I cant get it done. What do I miss ?
I don't know what you've tried to do so I can't say what you may have
missed. I believe the script below will accomplish the desired result as
long as the account is not a sysadmin or the database owner.
EXEC sp_grantlogin 'Milestone\BBP'
GO
USE Milestone_TEST
GO
EXEC sp_grantdbaccess 'Milestone\BBP', 'Kuku'
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Boaz Ben-Porat" <bbp@.milestone.dk> wrote in message
news:e2Zd%23SDCEHA.3472@.TK2MSFTNGP09.phx.gbl...
> I am newbe to MS SqlServer, and can`t find out how to do create a
Login/User
> so when I am log on Windows network as a given user and then connect to an
> instance of SqlServer, I am connected to a specific database as a specific
> user.
> Example of what I`m trying to do:
> - Windows network domain : Milestone
> - Domain user : BBP
> - SqlServer registration name : MTN002
> - Database name (on MTN002) : Milestone_TEST
> -- SqlServer user I wish to be: : Kuku
>
> When I log on to network domain Milestone as user BBP, start SQL Query
> Analyzer and run the query "SELECT USER", I want to see the result "Kuku".
> Somehow I cant get it done. What do I miss ?
> TIA
> Boaz Ben-Porat
> Milestone Systems
>
>
>

No comments:

Post a Comment