3 ms·
I'd love to see the MERGE statement from MSSQL in other databases. Wonderful tool for integrations.
by egeozcan 7y ago
I'd love to see the MERGE statement from MSSQL in other databases. Wonderful tool for integrations.
- kardianos 7y agoI've had to personally avoid MERGE statements due to implementation problems in MSSQLServer. One system just updated to 2019, so maybe it is better now. I also have to lookup the syntax each time, but that might be just me.
- egeozcan 7y agoIn some projects the MERGE helped me a lot and in my previous job, all of our integration scripts were merge based. You just learn to avoid the pitfalls, but you're right that it does have some: https://www.mssqltips.com/sqlservertip/3074/use-caution-with-sql-servers-merge-statement/ https://www.mssqltips.com/sqlservertip/3074/use-caution-with... I'm sure if postgres had it, it wouldn't have had most of those problems.
- manigandham 7y agoPostgres has UPSERT (INSERT INTO ... ON CONFLICT DO ... ) I wish MSSQL had this.
- electrotype 7y agoBut this doesn't deal with DELETEs of a true MERGE statement
- manigandham 7y agoNo, it's not a replacement. It's just a very useful feature that I wish all DBs had.
- nickpeterson 7y agoMerge statement always comes with a bunch of caveats from MSSQL experts, has that changed recently?
- egeozcan 7y agoIt does have a bunch, but all of them are implementation problems, AFAICT. The idea is great though.