DataBase
[Sqlite] Table 존재 유무 확인
izen8
2015. 10. 26. 11:16
Sqlite 역시 다른 DB 와 마찬가지로 master table 이 존재
SELECT sql FROM sqlite_master WHERE name='테이블이름' AND sql LIKE '%컬럼이름%'
or
string sQuery = "select count(*) from sqlite_master Where Name = 'table_name';
result
- 0 : 존재하지 않음
- 1 : 존재
.db 에 존재하는 모든 테이블 출력
SELECT name FROM sqlite_master WHERE type = 'table'
.db 에 존재하는 모든 테이블 정의 출력
SELECT sql FROM sqlite_master WHERE type='table' AND sql like '%user%'