SQL SERVER – Fix : Error 8629 The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time.

Error:

Error : 8629 The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time.

Fix/WorkAround/Solution:
This error happens usually when multiple rows are updated and their clustering key is part of update. If multiple row of which clustering keys are updated there is always possibility that they end up having same value, which will violate the clustering key requirements.

Update one row at the time in this situation. Use while loop or cursor (I do not recommend cursor usage)

Reference : Pinal Dave (http://blog.SQLAuthority.com)

About these ads

2 thoughts on “SQL SERVER – Fix : Error 8629 The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time.

  1. Hello Pinal,

    My project was running successfully, all-of-sudden I get same error. In my case there is no cursor, but I am using PIVOT, from googling I found that its bug and there is patch for this.

    Is this really bug?

  2. Hello Imran,

    When there are patches available it means bug existed in existing product.

    It is quite common that bug suddenly shows up in the system which is running perfectly fine earlier. There are some bugs which shows up when certain conditions are met and patches are necessary at that time.

    Kind Regards,
    Pinal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s