r/SQLServer • • May 09 '26

Question Developing using ANSI SQL

I inherited a legacy application with a SQL Server backend. Some of the SQL is Microsoft-specific T-SQL. There is some concern about dependency on one database vendor, Microsoft, if the backend uses Microsoft-specific T-SQL which parts do, and the suggestion is to be database-agnostic. Are any shops worried about that? One idea raised was re-writing the backend code into ANSI SQL. Another idea was just to make the rule that future development should be ANSI-SQL compliant.

Is this a concern of others? If so, what are some options of database backends that people are using now, or suggestions on versions for people to test and verify their code runs against?

Thank you in advance!

0 Upvotes

27 comments sorted by

View all comments

Show parent comment

2

u/No_Resolution_9252 May 09 '26

Not really correct.

datetime2 IS ansi-compliant. (and iso compliant) as are the associated datetime2 functions.

datetime is not ansi-compliant (it precedes the ansi and iso standard) but primarily due to precision and range. any persisted datetime attribute will be able to be migrated to a higher precision ansi-compliant type just fine. As long as business logic isn't being executed against old data (and it shouldn't be following a migration) its not going to break migrating it