SQL Server Performance

Query on image column broken

Discussion in 'SQL Server 2005 T-SQL Performance Tuning' started by ds_martin, Jul 26, 2006.

  1. ds_martin New Member

    I have a table similar to this:
    Id int identity primary key
    ImageData image
    OtherField varchar(20) etc

    If I execute this against a record with a null imagedata:
    SELECT Id FROM MyTable WHERE Id=12345 AND ImageData IS NULL

    then the query more or less times out however
    SELECT * FROM MyTable WHERE Id=12345
    returns a result immediately.

    This query has been in place for a long time prior to moving to 2005. Can anyone suggest a reason why including an image or text column in the query criteria does not work in 2005 (it is happening in other tables also).

    DBCC CheckTable returns no errors.

    Regards, Martin.
  2. satya Moderator

    Any error or warning information during this process execution?

    Satya SKJ
    Microsoft SQL Server MVP
    Contributing Editor & Forums Moderator
    This posting is provided �AS IS� with no rights for the sake of knowledge sharing.
  3. ds_martin New Member

    No, nothing, it just takes a very long time to execute.
    It is on a production system so I generally kill it before it starts table locks.

Share This Page