Bulk Delete

  • Looking for a way to delete SQL Server table that is a terabyte in size without trying up resources.

  • Do you mean drop the table or delete the data within it?

    To delete the data try:-

    truncate table

    Regards,

    Andy Jones

    .

  • Want to delete the data from the table, but it is a live server that I can not tie up the resources of. Truncate could possibly tie up all resources for hours. Have thought about a DTS package that would call a thousand records at a time and fire every couple of mintues but that could take days.

  • Are you wanting to remove all records from the table or just selected ones?

    Truncate table is the best way to go if it is all records due to its minimal logging.



    Michelle

  • quote:


    Truncate could possibly tie up all resources for hours


    Unlike the tsql command delete, truncate does not log each deletion and so should be quick. Using the second option a DTS package would be unnecessary as you could achieve this with a simple TSQL statement.

    Regards,

    Andy Jones

    Edited by - andyj93 on 01/14/2003 09:36:42 AM

    .

  • Yes, truncate actually doesn't even remove the data when it works. It just marks a truncate in the logg and invalidates the poitner to the tables actual data in the system tables. Should be a matter of a moment, nothing more.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply