System Messages

Under rare circumstances, a CONVERT function that appears in the select_list of a SELECT statement may raise an error. This can occur only if you convert data into text or image, and SQL Server attempts to store the converted data into a worktable. Worktable use is most common when requesting operations that require SQL Server to sort data.

For example, the following query would raise an error:

SELECT CONVERT (image, name) FROM sysobjects ORDER BY type 
  

You would receive the following error message:

Text data created by the CONVERT() function cannot 
be stored in worktables at this time.
  

To avoid this error, do not convert data to text or image in SELECT statements that may require a worktable. This includes SELECT statements containing ORDER BY, GROUP BY, and aggregate functions. Worktable use can be determined by using Showplans.