Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Applies to: 
 SQL Server
Returns privilege information about the specified table from the specified linked server.
 Transact-SQL syntax conventions
Syntax
sp_table_privileges_ex
    [ @table_server = ] N'table_server'
    [ , [ @table_name = ] N'table_name' ]
    [ , [ @table_schema = ] N'table_schema' ]
    [ , [ @table_catalog = ] N'table_catalog' ]
    [ , [ @fUsePattern = ] fUsePattern ]
[ ; ]
Arguments
[ @table_server = ] N'table_server'
The name of the linked server for which to return information. @table_server is sysname, with no default.
[ @table_name = ] N'table_name'
The name of the table for which to provide table privilege information. @table_name is sysname, with a default of NULL.
[ @table_schema = ] N'table_schema'
The table schema. This in some DBMS environments is the table owner. @table_schema is sysname, with a default of NULL.
[ @table_catalog = ] N'table_catalog'
The name of the database in which the specified @table_name resides. @table_catalog is sysname, with a default of NULL.
[ @fUsePattern = ] fUsePattern
Determines whether the characters _, %, [, and ] are interpreted as wildcard characters. Valid values are 0 (pattern matching is off) and 1 (pattern matching is on). @fUsePattern is bit, with a default of 1.
Return code values
None.
Result set
| Column name | Data type | Description | 
|---|---|---|
| TABLE_CAT | sysname | Table qualifier name. Various DBMS products support three-part naming for tables ( <qualifier>.<owner>.<name>). In SQL Server, this column represents the database name. In some products, it represents the server name of the table's database environment. This field can beNULL. | 
| TABLE_SCHEM | sysname | Table owner name. In SQL Server, this column represents the name of the database user who created the table. This field always returns a value. | 
| TABLE_NAME | sysname | Table name. This field always returns a value. | 
| GRANTOR | sysname | Database username that's granted permissions on this TABLE_NAMEto the listedGRANTEE. In SQL Server, this column is always the same as theTABLE_OWNER. This field always returns a value. Also, theGRANTORcolumn might be either the database owner (TABLE_OWNER) or a user to whom the database owner granted permission by using theWITH GRANT OPTIONclause in theGRANTstatement. | 
| GRANTEE | sysname | Database username that's been granted permissions on this TABLE_NAMEby the listedGRANTOR. This field always returns a value. | 
| PRIVILEGE | varchar(32) | One of the available table permissions. Table permissions can be one of the following values, or other values supported by the data source when implementation is defined. SELECT=GRANTEEcan retrieve data for one or more of the columns.INSERT=GRANTEEcan provide data for new rows for one or more of the columns.UPDATE=GRANTEEcan modify existing data for one or more of the columns.DELETE=GRANTEEcan remove rows from the table.REFERENCES=GRANTEEcan reference a column in a foreign table in a primary key/foreign key relationship. In SQL Server, primary key/foreign key relationships are defined by using table constraints.The scope of action given to the GRANTEEby a specific table privilege is data source-dependent. For example, theUPDATEpermission could enable theGRANTEEto update all columns in a table on one data source and only those columns for which theGRANTORhas UPDATE permission on another data source. | 
| IS_GRANTABLE | varchar(3) | Indicates whether the GRANTEEis permitted to grant permissions to other users. This is often referred to as "grant with grant" permission. Can beYES,NO, orNULL. An unknown, orNULL, value refers to a data source in which "grant with grant" isn't applicable. | 
Remarks
The results returned are ordered by TABLE_QUALIFIER, TABLE_OWNER, TABLE_NAME, and PRIVILEGE.
Permissions
Requires SELECT permission on the schema.
Examples
The following example returns privilege information about tables with names that start with Product in the AdventureWorks2022 database from the specified linked server Seattle1. SQL Server is assumed as the linked server.
EXECUTE sp_table_privileges_ex
    @table_server = 'Seattle1',
    @table_name = 'Product%',
    @table_schema = 'Production',
    @table_catalog = 'AdventureWorks2022';