slow record deletion with large ntext values

Posted by asking on Stack Overflow See other posts from Stack Overflow or by asking
Published on 2013-10-29T15:51:30Z Indexed on 2013/10/29 15:53 UTC
Read the original article Hit count: 224

Filed under:

I'm having trouble deleting some records via a stored procedure from a table in SQLServer 2008R2 that has ntext columns. The stored proc is timing out and running the query directly takes a very long time. The initial query was a straight "delete from y where x = z" and I've also tried running it in batches of 1000 with transactions but it is still slow and timing out in a stored proc. The majority of the records in the table will not be deleted each time (it's not just a once-off query but will be run other times). The ntext columns are not used in the where clause and I can't change the column types.

Any suggestions on the quickest way to delete records with large ntext values?

Thanks

© Stack Overflow or respective owner

Related posts about sql-server