SQL Server Performance

Cursor and Procedure

Discussion in 'General Developer Questions' started by snow12, May 18, 2008.

  1. snow12 New Member

    hello:
    I want find that the ntext column data string have more than 2000 characters. I need to truncate those string to segment with 200 character, then put those segments along with their table_name and column_name to another table. Maybe need to use cursor? If so, how to use it?

    Your help is highly appreciated.
  2. satya Moderator

  3. FrankKalis Moderator

    Check out the DATALENGTH() explanations in BOL.
  4. Madhivanan Moderator

    Can you simulate this logic?

    declare @t table(n ntext)
    insert into @t
    select 'this is test string'
    select substring(n,number*5-5,5) from @t t join master..spt_values m
    on m.number<datalength(t.n) where type='p' and substring(n,number*5-5,5) >''

Share This Page