General information
Forum:
Microsoft SQL Server
Category:
Database management
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only