T-SQL Tutorial

T-SQL Sp_column_privileges


On Transact SQL language the sp_column_privileges is part of Catalog Stored Procedures and return column privilege information for a single table in the current database.

Sp_column_privileges syntax:

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





Sp_column_privileges example 1:

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

Sp_column_privileges example 2:

USE model;
GO
EXEC sp_column_privileges
@table_name = 'students',
@table_owner = 'dbo',
@table_qualifier = 'model',
@column_name = 'first_name';