It depends on the database, but usually there are some tables that always exist or a table is not even required.
For Oracle:
SELECT 1 FROM dual
For SqlServer:
SELECT 1
Not very elegant, but usually does the job if you know the brand of the database.
source
share