How to Obtain the Table ID of a Table

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 如何获取一张表的table_id

| username: 心在飞翔

[TiDB Usage Environment] Production Environment
[TiDB Version]
v7.5.1

After configuring ticdc, I found that only the table_id of the table is displayed in the detailed synchronization task query. There is no table_id information in INFORMATION_SCHEMA.TABLES. How can I obtain the table_id, or how can I get the table name through the table_id?

| username: DBAER | Original post link

There are relevant records in the information_schema.TIKV_REGION_STATUS table.

| username: tidb菜鸟一只 | Original post link

SELECT a.`TIDB_TABLE_ID` FROM INFORMATION_SCHEMA.tables a;
| username: 心在飞翔 | Original post link

SELECT a.TIDB_TABLE_ID, a.TABLE_SCHEMA, a.TABLE_NAME, a.TABLE_TYPE FROM INFORMATION_SCHEMA.tables a WHERE a.TABLE_SCHEMA = ‘t_test’ This query is slightly better than yours.

| username: 心在飞翔 | Original post link

Thank you for your help.

| username: TiDBer_vJGTQABF | Original post link

SELECT * FROM INFORMATION_SCHEMA.tables