2024-08-26 12:40:04 +00:00
---
slug: /en/sql-reference/statements/check-grant
sidebar_position: 56
sidebar_label: CHECK GRANT
title: "CHECK GRANT Statement"
---
2024-10-02 00:11:17 +00:00
The `CHECK GRANT` query is used to check whether the current user/role has been granted a specific privilege.
2024-08-26 12:40:04 +00:00
## Syntax
The basic syntax of the query is as follows:
```sql
2024-10-02 00:11:17 +00:00
CHECK GRANT privilege[(column_name [,...])] [,...] ON {db.table[*]|db[*].*|*.*|table[*]|*}
2024-08-26 12:40:04 +00:00
```
- `privilege` — Type of privilege.
## Examples
2024-10-02 00:11:17 +00:00
If the user used to be granted the privilege, the response`check_grant` will be `1` . Otherwise, the response `check_grant` will be `0` .
2024-08-26 12:40:04 +00:00
If `table_1.col1` exists and current user is granted by privilege `SELECT` /`SELECT(con)` or role(with privilege), the response is `1` .
```sql
CHECK GRANT SELECT(col1) ON table_1;
```
```text
2024-10-02 00:11:17 +00:00
┌─result─┐
│ 1 │
└────────┘
2024-08-26 12:40:04 +00:00
```
If `table_2.col2` doesn't exists, or current user is not granted by privilege `SELECT` /`SELECT(con)` or role(with privilege), the response is `0` .
```sql
CHECK GRANT SELECT(col2) ON table_2;
```
```text
2024-10-02 00:11:17 +00:00
┌─result─┐
│ 0 │
└────────┘
2024-08-26 12:40:04 +00:00
```
2024-10-02 00:11:17 +00:00
## Wildcard
Specifying privileges you can use asterisk (`*`) instead of a table or a database name. Please check [WILDCARD GRANTS ](../../sql-reference/statements/grant.md#wildcard-grants ) for wildcard rules.