June 2, 2010 at 2:14 pm
i got a database named sqlbox
and a user named sam
and i want to grant select permissions to sam on that database sqlbox.
what is the query to set that permissions
June 2, 2010 at 2:21 pm
USE sqlbox
GO
EXEC sp_addrolemember N'db_datareader', N'sam'
GO
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
June 2, 2010 at 3:41 pm
June 3, 2010 at 2:56 am
Dugi is correct - it is best practice to grant least privileges - though I rarely manipulate permissions per user. It usually makes more sense to grant to a group or role, and add the user to that.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply