July 21, 2010 at 9:06 pm
Hi everyone,
I want to deny user permission to select from a table. I wrote below code in SQl server and ran it but I got this error:
"Cannot find the user 'Fateme_Hei', because it does not exist or you do not have permission."
USE HCTransNZ
DENY SELECT ON dbo.AdhocSecurity TO Fateme_Hei
GO
I'll appreciate for any help.
Ragards,
Fateme
July 22, 2010 at 5:39 am
well, i'm confident you didn't misspell the user, so here is my best guess:
the user Fateme_Hei is probably already a sysadmin. that LOGIN does not also have to be a USER in the database to get to the objects within.
you could add Fateme_Hei as a user:
CREATE USER [Fateme_Hei] FOR LOGIN [Fateme_Hei]
THEN you could add the deny statment...I'm not sure if that will work, but if it does work it might only annoy that user, who, as a sysadmin, can change the permissions back so he/she has access again.
Ideally, noone should be a sysadmin, and then your permissions idea would work correctly.
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply