I need to constantly merge (upsert/delete) data from an ODBC data source to a SQL Server 2008 database (number of rows vary from one row to 100000 of rows)
What would you recommend as the most efficient approach (using .net 3.5 ):
- Use
SqlBulkCopy
into temp table then call stored procedure with Merge command using temp table as source. - Calling a Stored procedure that has a table value parameter, where data is sent as a parameter (
SqlDbType.Structured
), table parameter used as source of merge command. Is the data sent via table parameter sent to server in a bulk operation? Is it possible and efficient to use it in cases where there are > 1000 rows? - Call stored procedure with merge command that uses
OpenRowset
bulk to get the data from the ODBC source (use linked server?) - Any other way.
Thank you!