Working with Microsoft SQL Server for the first time in two years, so a few notes to self:

  1. Escape single quotes with two single quotes, not with addslashes().
  2. @@TEXTSIZE returns the current value of the TEXTSIZE option of the SET statement, which specifies the maximum length, in bytes, of text or image data that a SELECT statement returns.

An example of using TEXTSIZE:

SELECT @@TEXTSIZE
SET TEXTSIZE 2048
SELECT @@TEXTSIZE

Which results in:

------------------------
64512

------------------------
2048

From Journey to SQL Authority with Pinal Dive and MSDN.

Leave a Reply