Where can I find a list of ANSI SQL keywords/functions?

2.3k Views Asked by At

I am developing an app using SQL Server, but I've been asked to keep it compatible with the ANSI standard as much as possible in case we need to change to a different database in the future.

Is there a list of functions supported by pure ANSI SQL somewhere? I would have thought there would be, but I haven't been able to find one after 20 minutes on Google.

1

There are 1 best solutions below

0
On

but I've been asked to keep it compatible with the ANSI standard as much as possible in case we need to change to a different database in the future.

Note that ANSI compatibility is not sufficient to guarantee portability, as SQL Server's ANSI-compatible syntax may not be implemented by some other platform.

Best practice to maximize portability is to minimize database-side stored procedures and functions, as these always are different, and (as you are doing) prefer the ANSI flavor of doing something to a proprietary one. EG use CASE not ISNULL, etc.

At the end of the day you should plan to have an abstraction layer in your application that would allow you to change databases or support multiple. If you use an Object-Relational Mapping (ORM) in your app (like Entity Framework, Hibernate, etc), that can be used to minimize and manage the application code dependency on a particular RDBMS.