0

A 3rd party API exposes a endpoint which accepts "SQL" queries. Their examples are simple SELECT statements, however I want to write more complicated queries.

They do not specify which SQL brand they are using, which means I don't know the exact syntax I should be following.

How can I identify the SQL brand (SQL Server, MySQL, Azure SQL, Postgres, etc) with one or more SQL queries (no command line access, file permissions, etc)?

1
  • How do you know they just pass-thru the query statements? Most likely they do some sanity checking, filtering and translations before querying their data store. They most likely only support a small subset of SQL.
    – DJ.
    Commented Dec 13, 2023 at 18:12

2 Answers 2

7

Go by elimination. Failing select @@version will eliminate both SQL Server and MySQL; failing select version() will eliminate both Postgres and MySQL; etc.

Examples of such queries have been helpfully compiled by Jack Douglas, the fine gentleman behind db<>fiddle.

1
0

Just ask the service provider.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.