Bulk Copy Operation

using (SqlConnection sc = new SqlConnection(connectionString)) { sc.Open(); SqlCommand commandSourceData = new SqlCommand("SELECT * FROM StoresBackup;", sc); SqlDataReader reader = commandSourceData.ExecuteReader(); using (SqlConnection dc = new SqlConnection(connectionString)) { dc.Open(); using (SqlBulkCopy bulkCopy = new SqlBulkCopy(dc)) { bulkCopy.DestinationTableName = "Stores"; bulkCopy.WriteToServer(reader); }
Ebook Download
View all
Learn
View all