Count Number of Words and Characters

  • Atif-ullah Sheikh

    SSChampion

    Points: 12495

    Comments posted to this topic are about the item Count Number of Words and Characters

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • kishor.raskar

    Grasshopper

    Points: 18

    Hello sir in your number of words count code, what is use of while block because it is done without using while block

  • ra.shinde

    Mr or Mrs. 500

    Points: 564

    If I am not wrong, that while loop will never end.

  • lizardalpha

    Valued Member

    Points: 50

    ra.shinde, you are correct, the while loop will never end. Besides from your first function you can derive the word count as well. See code below:

    -- Number of specific Characters

    Declare @aa varchar(100)

    Set @aa = 'SQL Server 2005 Atif Sheikh A'

    Select Len(@aa) - Len(Replace(@aa, ' ', '')) + 1

  • Atif-ullah Sheikh

    SSChampion

    Points: 12495

    WHILE loop is there by mistake (was testing something before posting it). Please ignore it.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • The Danish Dynamo

    SSC-Addicted

    Points: 464

    i posted that solution years ago, you just copied it and messed it up, please delete it

  • Atif-ullah Sheikh

    SSChampion

    Points: 12495

    The Danish Dynamo (7/30/2010)


    i posted that solution years ago, you just copied it and messed it up, please delete it

    Really :w00t:? And how "messed up"?

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the script.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply