READTEXT
READTEXT { table.column text_ptr [ WITH LOCK ] [ { FIPS_FLAGGER [ OFF ] } ] [ size [ OFFSET start ] ] } [ HOLDLOCK ]]
Section titled “READTEXT { table.column text_ptr [ WITH LOCK ] [ { FIPS_FLAGGER [ OFF ] } ] [ size [ OFFSET start ] ] } [ HOLDLOCK ]]”Example
Section titled “Example”DECLARE @pointer binary(16)SELECT @pointer = TEXTPTR(Resume)FROM ApplicantsWHERE ApplicantID = 1READTEXT Applicants.Resume @pointer 0 50Output
Section titled “Output”"An accomplished software engineer specialized in object-or..."Explanation
Section titled “Explanation”In the example, READTEXT is used on the “Resume” column from the “Applicants” table. It reads the text, ntext, or image value - where the ID is 1 - from the offset 0 and for 50 bytes. The output is the first 50 bytes of the “Resume” field of the applicant with an ID of 1.