What\'s the best way to check if a table exists in a Sql database in a database independant way?
I came up with:
bool exists;
const string sql
I would avoid executing the select count(x) from xxxxxx as the DBMS will actually go ahead and do it which may take some time for a large table.
Instead just prepare a select * from mysterytable query. The prepare will fail if mysterytable does not exist. There is no need to actually execute the prepared statement.