Is there a SELECT command that can list all attached databases similar to the .database command available in sqlite3?
+3
A:
You cannot do this with a SELECT statement that I know of (though you might want to look around in the main
database, this data might be stored there). However, there is a solution. If you execute the following statement it will return the databases attached for the current connection:
PRAGMA database_list;
The first row will always be the main database, the second will always be the temp database. Any further databases are after these first two. You can run this statement against your database the same way you would a SELECT statement from your code in c# (or anything else for that matter).
Here is a good reference:
SQLite PRAGMA statement reference
Good luck!
Tim C
2010-03-19 00:13:53
This worked perfectly. Thanks!
galford13x
2010-03-19 20:47:28