Hi:
What would be the easiest & most efficient way to put data aside of SQL Server 7 DB (200 tables, 500 MB), change the structure of the DB, and then move data back – bcp, backup & restore DB & select into, or something else?
Thanks in advance.
Andrei
If you are going to change the structure of the existing DB, BCP would probably be best for exporting the data. You could also use DTS.
Once you modify the DB, you could import the data using BCP, DTS or BULK INSERT. All do bulk copies and would be reasonably fast.
Another option is to restore a backup of the database to a different name. Then you can transfer the data to the modifed DB using T-SQL. I find this is usually easier but may take longer to run. Terry
Terry, thanks.
I'd like to expand a little my question, if I may:
Is bcp good to trasfer data if the structure of the tables changed?
Also, it looks like I can't use DTS because after I use Export Wizard on SQL Server 7 to transfer 500 MB of data, my transaction log on target DB grows to 380 MB (select into\bulk copy option is checked). And I can't shrink it. So, the question is how to avoid transaction log expanding during data import\export? I can't break data onto smaller pieces, because there are only few tables, and transferring data from each of them provokes log expanding.
Andrei
In SQL 7.0 it is possible to change a table of structure without the use of BCP command and still keep all the data. There are some limitations on it, but when you change a table to add columns or to delete columns or to make one column bigger SQL*Server will do it automatically for you.
You only have to change the column in design time in the Enterprise manager and SQL*Server will generate the nessesary scripts.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.