Moving part of data from a table to another table | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Moving part of data from a table to another table

Hi All On the production server a table contains 50 millions records. I want to move any 5 millions records out of this table to another new table. I have 2 hours to complete this task. I am allowed to shut down the server for this 2 hours.
I want to know what would be the best, secure and rapid method of moving ( as there are few ways data can be move within or another database server) such a large data in this situation and why? I also like to aware of what precaution I should be taken? Thanks in advance
regards

You can use BCP with a specified view to get the required rows and make sure to test the process before deploying it on production server. Refer to Books Online for more information on BCP. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided �AS IS� with no rights for the sake of knowledge sharing.
Sonny,<br /><br />Is this process you are going to do only for once or will you be doing it like every week or month?<br /><br />Wasay ki hal ha [<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />].<br /><br />Waqar.<br /><br />________________________________________________<br />~* Opinions are like a$$holes, everyone got one. *~
Hi
satya… Thanks. why BCP will be the choice in this situation? what other method could be suitable in this situation? any example script??? Waqar… yes it would be weekly basis operation… vasay tik tak hoon. aap batao kese ho? Regards
sonny
Paaji,
Due to the volume of the data BCP is suitable as it will keepup the performance and refer to Books online more information on code examples. http://www.databasejournal.com/features/mssql/article.php/3391761
http://www.databasejournal.com/features/mssql/article.php/3095511
http://www.sqlteam.com/item.asp?ItemID=4722
http://www.sqlteam.com/filtertopics.asp?topicID=165 Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided �AS IS� with no rights for the sake of knowledge sharing.
Thanks a lot Satya Paaji.. regards
]]>