I wrote a simple c# code that connect to sql-server database and execute a query:
cmd = new SqlCommand(txtQuery.Text.ToString().Trim(), con);
cmd
You cannot REVOKE something you did not GRANT. Looks like you want to:
user2
has permission to SELECTuser2
The permission work like following:
The rules of precedence are that any DENY take precedence over any GRANT or inherited privilege. One can get access through a number of GRANTs but one single DENY will revoke the privilege. You cannot GRANT/REVOKE/DENY permissions to the securable owner (members of db_owner
own everything and members of sysadmin
own everything on the entire server).