How to quickly update an xml column in a table to NULL

  • Hi,

    I have a table with hundreds of millions of records and need to update an xml column to null.

    I do something like this:

    UPDATE [Mydb].[MySchema].[MyTable]

    SET [XMLColumn] = null

    Currently it is taking around 6 hours.

    Is there a quicker way to do this?

    Thanks

  • If this column should have NULL in all rows you can create a new nullable column with the name XmlColumn2 and then swap the names between XmlColumn and XmlColumn2 columns by using the system stored procedure sp_rename and at the end finally drop the original column.

    ___________________________
    Do Not Optimize for Exceptions!

Viewing 2 posts - 1 through 1 (of 1 total)

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