How to list the tables in a SQLite database file that was opened with ATTACH?

前端 未结 17 2466
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 11:33

What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the

17条回答
  •  温柔的废话
    2020-11-22 12:04

    It appears you need to go through the sqlite_master table, like this:

    SELECT * FROM dbname.sqlite_master WHERE type='table';
    

    And then manually go through each table with a SELECT or similar to look at the rows.

    The .DUMP and .SCHEMA commands doesn't appear to see the database at all.

提交回复
热议问题