sql - Insert data from a 50 GB table to another 100GB table -
I need to insert data from a 50 GB table table 1 to another 100 GB table Columns of My code: entered in table1
are all Columns of all varchar (50)
, and table2
in the same database table2
Int and float
. Table 1: Non Clustered Primary Key ID 1 ID2 Values - All types are varchar (50) 242 8965 8974202.87412 Table 2: id1 id2 clustered primary key id1 id2 value - ID1 and ID2 types are int, value float is 257 872 9826531.889
INSERT [my_db]. [Dbo]. [D2] [table2] Select cast (a.value as flot) cast (a.id1 as INT), cast (a.id1 as INT) from [My_db]. [Dbo]. As a table, what is the
table1
table2
?
I recommend using SSIS to change the data to get better performance .
If you do not want to use SSIS, then I suggest leaving all the indexes and foreign keys and for the constraint and trigger and start your own convert and then make them.
Use the following query to save the data before you convert the check duplicate record in Table 1 and then from Table 1 to Table 2:
INSERT [My_db] [D2]. [Table 2] Selection cast (AID as I.A.), Dali (AID2Int), Dali (A value in the form of float) [my_db]. [DBO]. [My_db] as a left zone [Table 1]. [Dbo]. [Table2] AS B on BID1 = a.id1 and B.ID2 = a.id2 WHERE b.id1 is null
Comments
Post a Comment