Created
May 29, 2014 19:04
-
-
Save weeksdev/f660ecf004de9f8f1324 to your computer and use it in GitHub Desktop.
SqlBulkCopy
This file contains hidden or 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
| var copy = new System.Data.SqlClient.SqlBulkCopy(connectionString); | |
| System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from someTable",connection); | |
| var reader = command.ExecuteReader(); | |
| copy.DestinationTableName = "destinationTable"; | |
| copy.WriteToServer(reader); | |
| copy.Close(); | |
| connection.Close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment