SQL 2k Tips : UPDATETEXT

July 4, 2006

I have received the email from Grace on Tuesday, February 01, 2005 4:07 PM. Wow! She was sharing some interesting things related to SQL.
Thank you so much, Grace!

Hi Micheal,

Do you know that ntext data type can’t do concatenation. To overcome this problem, we can use UPDATETEXT.
The following are the example of using UPDATETEXT.

DECLARE @ptrval binary(16)
Declare @strComments nvarchar(4000)

SET @strComments = 'comments'

SELECT @ptrval = TEXTPTR(rd.Comment)
FROM vyRequisitionDetails rd
WHERE rd.RequisitionID = 'REQPhyuHT02012005-Delhi'

UPDATETEXT vyRequisitionDetails.Comment @ptrval NULL 0 @strComments

Grace

SQL 2k Tips : UPDATETEXT

posted in Microsoft SQL by Michael Sync

Follow comments via the RSS Feed | Leave a comment | Trackback URL

1 Comment to "SQL 2k Tips : UPDATETEXT"

  1. naved wrote:

    here i have aproblem regarding ntext datatype.
    i have a ntext feild in which i have to insert a html table format.
    how can i use updatetext

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org