Hi Cenk,
You can
1) bulk copy the 30m-row table of DB1 into a temporary table in DB2,
2) do a join between the temporary table and the 6m-row in DB2
3) insert the joined data into the 6m-row in DB2
To speed things up, you can build an index on the new table as part as a
step 2b.
Even if you do not have permission to create a table in DB2, you should have
permission to create a temporary table. (Temp tables start with # in T-SQL
DDL.) Even the `datareader' role has permission to create a temp table, I
believe.
The only danger is that if you are working at a major corporation that uses
solid state drives to store the temporary SQL Server database (tempdb) you
run the risk of overflowing your drive. This should really be an issue in
less than 1% of all enterprise implementations.
Good luck,
Philippe Lacoude
"CENK" <CENK (AT) discussions (DOT) microsoft.com> wrote
Quote:
hi,
i have 2 huge DBs, lets say DB1 has 30,000,000 rows and DB2 has 6,000,000
rows. I wanna bulk insert datas from DB2 into DB1 but there are common
datas
so, i only want to insert DISTICT datas. How can i do this in a very very
fast way?
thanks
--
One by one they all went down |