Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6881551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:07:19+00:00 2026-05-27T05:07:19+00:00

I have a text like: Sentence one. Sentence two. Sentence three. I want it

  • 0

I have a text like: Sentence one. Sentence two. Sentence three.

I want it to be:

  • Sentence one.
  • Sentence two.
  • Sentence three.

I assume I can replace '.' with '.' + char(10) + char(13), but how can I go about bullets? ‘•’ character works fine if printed manually I just do not know how to bullet every sentence including the first.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:07:20+00:00Added an answer on May 27, 2026 at 5:07 am

    Here’s my over-the-top approach but I feel it’s a fairly solid approach. It combines classic SQL problem solving techniques of Number tables for string slitting and use of the FOR XML for concatenating the split lines back together. The code is long but the only place you’d need to actually edit is the SOURCE_DATA section.

    No knock on @Jeremy Wiggins approach, but I prefer mine as it lends itself well to a set based approach in addition to being fairly efficient code.

    -- This code will rip lines apart based on @delimiter
    -- and put them back together based on @rebind
    DECLARE 
        @delimiter char(1)
    ,   @rebind varchar(10);
    
    SELECT
        @delimiter = '.'
    ,   @rebind = char(10) + char(149) + ' ';
    
    ;
    -- L0 to L5 simulate a numbers table
    -- http://billfellows.blogspot.com/2009/11/fast-number-generator.html
    WITH L0 AS
    (
        SELECT
            0 AS C
        UNION ALL
        SELECT
            0
    )
    , L1 AS
    (
        SELECT
            0 AS c
        FROM
            L0 AS A
            CROSS JOIN L0 AS B
    )
    , L2 AS
    (
        SELECT
            0 AS c
        FROM
            L1 AS A
            CROSS JOIN L1 AS B
    )
    , L3 AS
    (
        SELECT
            0 AS c
        FROM
            L2 AS A
            CROSS JOIN L2 AS B
    )
    , L4 AS
    (
        SELECT
            0 AS c
        FROM
            L3 AS A
            CROSS JOIN L3 AS B
    )
    , L5 AS
    (
        SELECT
            0 AS c
        FROM
            L4 AS A
            CROSS JOIN L4 AS B
    )
    , NUMS AS
    (
        SELECT
            ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS number
        FROM
            L5
    )
    , SOURCE_DATA (ID, content) AS
    (
        -- This query simulates your input data
        SELECT 1, 'Sentence one. Sentence two. Sentence three.'
        UNION ALL SELECT 7, 'In seed time learn, in harvest teach, in winter enjoy.Drive your cart and your plow over the bones of the dead.The road of excess leads to the palace of wisdom.Prudence is a rich, ugly old maid courted by Incapacity.He who desires but acts not, breeds pestilence.'
    )
    , MAX_LENGTH AS
    (
        -- this query is rather important. The current NUMS query generates a 
        -- very large set of numbers but we only need 1 to maximum lenth of our
        -- source data. We can take advantage of a 2008 feature of letting
        -- TOP take a dynamic value
        SELECT TOP (SELECT MAX(LEN(SD.content)) AS max_length FROM SOURCE_DATA SD)
            N.number
        FROM
            NUMS N
    )
    , MULTI_LINES AS
    (
        -- This query will make many lines out a single line based on the supplied delimiter
        -- Need to retain the ID (or some unique value from original data to regroup it
        -- http://www.sommarskog.se/arrays-in-sql-2005.html#tblnum
        SELECT 
            SD.ID
        ,   LTRIM(substring(SD.content, Number, charindex(@delimiter, SD.content + @delimiter, Number) - Number)) + @delimiter AS lines
        FROM
            MAX_LENGTH
            CROSS APPLY
                SOURCE_DATA SD
        WHERE
            Number <= len(SD.content)
            AND substring(@delimiter + SD.content, Number, 1) = @delimiter
    )
    , RECONSITITUE (content, ID) AS
    (
        -- use classic concatenation to put it all back together
        -- using CR/LF * (space) as delimiter
        -- as a correlated sub query and joined back to our original table to preserve IDs
        -- https://stackoverflow.com/questions/5196371/sql-query-concatenating-results-into-one-string
        SELECT DISTINCT 
        STUFF
        ( 
            (
                SELECT @rebind + M.lines
                FROM MULTI_LINES M
                WHERE M.ID = ML.ID
                FOR XML PATH('')
            )
        , 1
        , 1
        , '')
        ,   ML.ID
        FROM 
            MULTI_LINES ML
    )
    SELECT 
        R.content
    ,   R.ID
    FROM 
        RECONSITITUE R
    

    Results

    content                                                       ID
    -----------------------------------------------------------   ---
    • In seed time learn, in harvest teach, in winter enjoy.
    • Drive your cart and your plow over the bones of the dead.
    • The road of excess leads to the palace of wisdom.
    • Prudence is a rich, ugly old maid courted by Incapacity.
    • He who desires but acts not, breeds pestilence.             7
    • Sentence one.
    • Sentence two.
    • Sentence three.                                             1
    
    (2 row(s) affected)
    

    References

    • Number table
    • Splitting strings via number table
    • SQL Query – Concatenating Results into One String
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sentence like this one: [FindThis|foo|bar] with some text between [FindThis|foo|bar]. [FindThis|foo|bar]
I have a text like: test 1 test 2 test 3 and i want
I have a text like this [name:roccos] [phone:123324324] [tags:abc def ghi] [id:value] How can
I have a notepad with in fix format sentence like name... Image... Text... I
I'm trying to "stack" some text, but have one small word inserted among the
I have a problem, I want split a text into sentence using fullstop (.)
i have one sentence saved in database field , an i want to break
I have text data (in R) and want to replace some characters with other
I have text like this format term: 156^^^:^^59 datainput Or term: 156^^^:59 datainput or
i have text like this div bla-bla end div i need to get only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.