Insert large amount of data

Insert large amount of data

Post by Peter H » Thu, 15 Jun 2000 04:00:00



Hi, everyone:
    I have two tables, say they are Table A and Table B.  They have the
exact same table structure, and I want to copy the data in Table B to Table
A.  The number of records is usually about 5000, and each row only has maybe
200 bytes.  What is the fastest to do it in SQL, and how long do you think
is going to take?
 
 
 

Insert large amount of data

Post by Keith Kratochvi » Thu, 15 Jun 2000 04:00:00


Use INSERT INTO A (fields) SELECT (fields) FROM B
It should happen so fast that you will barely have time to blink an eye.

Keith


Quote:> Hi, everyone:
>     I have two tables, say they are Table A and Table B.  They have the
> exact same table structure, and I want to copy the data in Table B to
Table
> A.  The number of records is usually about 5000, and each row only has
maybe
> 200 bytes.  What is the fastest to do it in SQL, and how long do you think
> is going to take?


 
 
 

Insert large amount of data

Post by Bob Pfeif » Thu, 15 Jun 2000 04:00:00


There are a few ways to do it.  You could export the data from table B to a
text file using bcp, then import it to table A from the text file using bcp
or BULK INSERT, or use DTS to move the data, or insert into tableA select *
from tableB.

I don't think any of these will take a terribly long time with 5000 rows of
data.

 
 
 

Insert large amount of data

Post by Vija » Thu, 15 Jun 2000 04:00:00


If  you want fastest way , its bcp but for your data it should not
matter..what do you use.


Quote:> Hi, everyone:
>     I have two tables, say they are Table A and Table B.  They have the
> exact same table structure, and I want to copy the data in Table B to
Table
> A.  The number of records is usually about 5000, and each row only has
maybe
> 200 bytes.  What is the fastest to do it in SQL, and how long do you think
> is going to take?

 
 
 

Insert large amount of data

Post by DineshT » Fri, 16 Jun 2000 04:00:00


Hi peter,
  Be specific.Since this is very much a sqlserver programming question,this
only is the best newsgrp why flood the others?

OK..coming to ur question...Since the 2 tables have the same structure u can
have the select into/from clause....Ex:
If table2 is not existing then :
select * into table2 from table1 .This requires :

1.That select into/from option is selected in ur databse properties.
2.That table2 is nonexistent.

else
u can try BCP or simple select statement

Bye
DineshTK

 
 
 

Insert large amount of data

Post by Natheer Khasawne » Fri, 16 Jun 2000 04:00:00


Adding to the above
you can go to the Entprise Manager and choose all tasks
and them import data
natheer

> Hi, everyone:
>     I have two tables, say they are Table A and Table B.  They have the
> exact same table structure, and I want to copy the data in Table B to Table
> A.  The number of records is usually about 5000, and each row only has maybe
> 200 bytes.  What is the fastest to do it in SQL, and how long do you think
> is going to take?

 
 
 

Insert large amount of data

Post by Natheer Khasawne » Fri, 16 Jun 2000 04:00:00


Adding to the above
you can go to the Entprise Manager and choose all tasks
and them import data
natheer

> Hi, everyone:
>     I have two tables, say they are Table A and Table B.  They have the
> exact same table structure, and I want to copy the data in Table B to Table
> A.  The number of records is usually about 5000, and each row only has maybe
> 200 bytes.  What is the fastest to do it in SQL, and how long do you think
> is going to take?

 
 
 

1. Constantly deleting and inserting large amount of data

Hi,

I will appreciate some ideas on the following issue. Our software has more
than one database for one (the same) enterprise client where one database
represents one suborganization in this enterprise. What the client wanted is
a consolidation utility to bring all this data together for reporting
purposes. We have done this by bringing (consolidate) all the required data
into one database and the reports run from this database. Everything works
fine, but we have to delete and insert (refresh) the data in the reports
database every night. This is also ok, but now the reports database grows
very big and I think it needs some kind of shrinking after the current data
has been removed and before the new data is inserted. And now the question,
what would be a good way of doing that. By reading Books Online I saw DBCC
SHRINKDATABASE which I used, but is it enough, is there a better approach...

Thanks,
regards,
George.

2. Null

3. Inserting large amounts of data into SQL

4. Database for Fund Raising Organization

5. How do i improve performance when inserting large amount of data

6. PL/SQL-Script to DROP COLUMN on Oracle 7.x?

7. INSERT Large amount of Data (image) problem ...

8. MSDE or JET

9. How do i speed up inserting a large amount of data into a very large table

10. Inserts of large amounts of data.

11. Moving large amount of data: ( INSERT INTO ? )

12. Inserting large amount of records in a SQL Server 2000 CE database using eVC++