paillave / Etl.Net

Mass processing data with a complete ETL for .net developers
https://paillave.github.io/Etl.Net/
MIT License
631 stars 89 forks source link

.SqlServerSave() support on MS SQL Server versions prior to 2005 #449

Open mickvikt opened 1 year ago

mickvikt commented 1 year ago

.SqlServerSave() currently generates sql query for INSERTs/UPDATEs using OUTPUT INSERTED.* clause which is not supported by SQL Server versions prior to 2005.

I know that this is legacy stuff, but ETL.NET would be very useful for migrating necessary scenarios from ancient versions like SQL Server 2000.

Could the query be adjusted? It would suffice to execution an additional SELECT query like SELECT * FROM <table> WHERE col1=@val1, col2=@val2, <...> coln=@valn to achieve the behaviour of OUTPUT INSERTED.*. I guess positional arguments would need to be used as well here to support connections from ODBC/OLE DB drivers.

This could probably be implemented by creating a new node, e.g. SqlServer2000SaveStreamNode.cs and adding a new extension method, say .ToSqlServer2000().

paillave commented 1 year ago

I am working on something that can make it work against old databases. It will come later as I am quiet busy at my side. Working on legacy sql server version is indeed a very high source of issues here. Will let you know.

paillave commented 4 months ago

Something should be coming soon, it still needs some more tests