BulkCopy with condition in C# for SQL Server

bcp c# sqlbulkcopy sql-server

Question

I'm trying to copy data from one server to another. The database I'm copying from is very large and updated daily and I'm interested in just copying the previous day.

Using bcp I can do this via the queryout option. Is it possible to set this when using SqlBulkCopy?

Popular Answer

It is not possible to add a WHERE clause to SqlBulkCopy. But you can filter the rows that you pass to the WriteToServer method yourself.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why