Skip to main content

Posts

Showing posts with the label server to server

Loading 50 million records in 50 minutes in SQL Server - Super fast data loading

 Greetings to all the readers!!  Yes, it is possible to load 1 million of records in 1 minute time from one SQL server to another.  Create an SSIS package with a Script task.  Add logging for ease of debugging and make all the connections configurable to make it re-usable.  In the script task, we have to use .net script given below. We can define the batch size and   timeout.  By Default, Identity in the destination is reset, in case you have to preserve it, amend the code       accordingly. In my task, I used SQL Server 2017, SSIS 2017 and the source system is SQL 2008 R2  C# using System.Data.SqlClient; class Program {     static void Main()     {         string connectionString = GetConnectionString();         // Open a sourceConnection to the AdventureWorks database.         using (SqlConnection sourceConnection =       ...