I am trying to dynamically create an SQL table only if it no longer exists. I have seen many solutions on the Internet, but they usually rely on a specific database, while I try to find the most general solution.
I thought that I always run the CREATE command, and then I assume that if it failed, then there is a table, and I can start inserting data into it. I see no flaws in this reasoning (apart from performance issues), but I could be wrong.
Is this an acceptable method?
Can you suggest other methods that are database independent or that use ANSI SQL that will accept all RDBMSs?
source
share