T-SQL Tutorial

T-SQL DENY


This article shows how to deny permissions on SQL Server database objects.
The T-SQL statement DENY is used to deny permissions in a database.



Deny syntax

DENY permission_name TO user_name;
DENY CONTROL ON USER::user_name_1 TO user_name_2;


Deny example

GO
DENY REFERENCES TO test_user;
DENY CREATE CERTIFICATE TO test_user;
DENY CONTROL ON USER::guest TO test_user;
GO