T-SQL Tutorial

T-SQL Sp_table_privileges


On Transact SQL language the sp_table_privileges is part of Catalog Stored Procedures and return a list of table permissions for the specified table or tables.

Sp_table_privileges syntax:

sp_table_privileges [ @table_name = 'Table name.' ] ,
[ @table_owner = 'The database user who created the table.' ] ,
[ @table_qualifier = 'Database name.' ] ;





Sp_table_privileges example 1:

USE model;
GO
EXEC sp_table_privileges
@table_name = '%';

Sp_table_privileges example 2:

USE model;
GO
EXEC sp_table_privileges
@table_name = 'students',
@table_owner = 'dbo',
@table_qualifier = 'model';