Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bulk copy database tables
Message
From
29/06/2006 06:14:05
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
 
General information
Forum:
Microsoft SQL Server
Category:
Database management
Miscellaneous
Thread ID:
01132649
Message ID:
01132654
Views:
13
For the logging either set your database to simple or bulk logged model. Check out Alter Database Set Recovery. Remember to switch it back after though.

Speed wise I think that BULK UPDATE may be quicker than Select into but it depends on how much data your moving.

Jon

>I want to be able to bulk copy all the tables in the database and rename them at the same time. I currently have code that finds all the tables in a database, loops through and does this:
>
>EXECUTE ('SELECT * INTO x_' + @tablename + ' FROM ' + @tablename)
>
>Whilst this works ok, I have 2 problems.
>
>1) Takes a long time
>2) Fills up transaction logs.
>
>Is there a way that could do it quicker and/or not do any logging?
>
>I also want to copy all the tables in 1 database into a newly created database but rename the tables at the same time. Is this possible using Stored Procedures?
>
>Many Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform