Created
July 10, 2020 12:44
-
-
Save mikependon/bdc8520b8ecb1362a61d40386fd9bfc9 to your computer and use it in GitHub Desktop.
RepoDb_ExecuteQuery_BulkInsert_Combination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source from PostgreSQL | |
using (var sourceConnection = new NpgqlConnection(connectionStringToPostgreSQL)) | |
{ | |
var sales = sourceConnection.QueryAll<Sale>(e => e.OrderDate >= 'FromDate' && e.OrderDate <= 'ToDate'); | |
// Destination to SQL Server | |
using (var destinationConnection = new SqlConnection(connectionStringToSqlServer)) | |
{ | |
destinationConnection.BulkInsert<Sale>(sales); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment