> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentation for Check Grant

# CHECK GRANT Statement

The `CHECK GRANT` query is used to check whether the current user/role has been granted a specific privilege.

<h2 id="syntax">
  Syntax
</h2>

The basic syntax of the query is as follows:

```sql theme={null}
CHECK GRANT privilege[(column_name [,...])] [,...] ON {db.table[*]|db[*].*|*.*|table[*]|*}
```

* `privilege` — Type of privilege.

<h2 id="examples">
  Examples
</h2>

If the user used to be granted the privilege, the response`check_grant` will be `1`. Otherwise, the response `check_grant` will be `0`.

If `table_1.col1` exists and current user is granted by privilege `SELECT`/`SELECT(con)` or role(with privilege), the response is `1`.

```sql theme={null}
CHECK GRANT SELECT(col1) ON table_1;
```

```text theme={null}
┌─result─┐
│      1 │
└────────┘
```

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 theme={null}
CHECK GRANT SELECT(col2) ON table_2;
```

```text theme={null}
┌─result─┐
│      0 │
└────────┘
```

<h2 id="wildcard">
  Wildcard
</h2>

Specifying privileges you can use asterisk (`*`) instead of a table or a database name. Please check [WILDCARD GRANTS](/reference/statements/grant#wildcard-grants) for wildcard rules.
