Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    7

    Question Unanswered: using text datatype

    hi

    i have a column type text i want to perform split functionality that is not currenctly availablein mssql server 2000.

    to achieve this i have to used len() , left() right() and substring() functions incase of varchar datatype.. but len(), right() and left() functions are not supported for text datatype....

    is anyone have ant solution to this problem....


    thanks in advance

  2. #2
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    substring() can be used in place of left() & right() and datalength() can be used in place of len()

  3. #3
    Join Date
    Feb 2007
    Posts
    7
    its ok but how can i use like
    set @string = subString(@string, @index2, datalength(@string))

    it gives an error what should i do for it\
    where @string is of text type
    @index2 is 10 (index of delimiter on which text data is being splitted)
    Last edited by curioushard; 02-21-07 at 05:33.

  4. #4
    Join Date
    Aug 2006
    Posts
    16
    You can use ReadText to split the Text column
    like
    DECLARE @ptrval varbinary(16)
    SELECT @ptrval = TEXTPTR(pr_info)
    FROM pub_info pr INNER JOIN publishers p
    ON pr.pub_id = p.pub_id
    AND p.pub_name = 'New Moon Books'
    READTEXT pub_info.pr_info @ptrval 1 25
    GO

    mention in ReadText from where you read text like i have mentioned in example reading the text from 1 to 25 character.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •