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 8029775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:32:14+00:00 2026-06-05T00:32:14+00:00

Is there a way to split a string (from a specific column) to n-number

  • 0

Is there a way to split a string (from a specific column) to n-number chars without breaking words, with each result in its own row?

Example:

2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in the PSO department  Customer states terms should be Net 60 not Net 30.  Please review signed contract for this information.

Results:

2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in the
PSO department  Customer states terms should be Net 60 not Net 30.
Please review signed contract for this information.

I know I can use charindex to find the last space, but im not sure how i can get the remaining ones and return them as rows.

  • 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-06-05T00:32:15+00:00Added an answer on June 5, 2026 at 12:32 am

    Try something like this. May be your can create a SQL function of following implementation.

    DECLARE @Str VARCHAR(1000)
    SET @Str = '2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in the PSO department  Customer states terms should be Net 60 not Net 30.  Please review signed contract for this information.'
    
    DECLARE @End INT
    DECLARE @Split INT
    
    SET @Split = 100
    
    declare @SomeTable table
    (
      Content varchar(3000)
    )
    
    
    WHILE (LEN(@Str) > 0)
    BEGIN
        IF (LEN(@Str) > @Split)
        BEGIN
            SET @End = LEN(LEFT(@Str, @Split)) - CHARINDEX(' ', REVERSE(LEFT(@Str, @Split)))
            INSERT INTO @SomeTable VALUES (RTRIM(LTRIM(LEFT(LEFT(@Str, @Split), @End))))
            SET @Str = SUBSTRING(@Str, @End + 1, LEN(@Str))
        END
        ELSE
        BEGIN
            INSERT INTO @SomeTable VALUES (RTRIM(LTRIM(@Str)))
            SET @Str = ''
        END
    END
    
    SELECT *
    FROM @SomeTable
    

    Output will be like this:

    2012-04-24 Change request #3 for the contract per terms and conditions and per John Smith in the
    PSO department  Customer states terms should be Net 60 not Net 30.  Please review signed contract
    for this information.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way in regex's to match a string that is arbitrarily split
I am getting a string from HttpContext.Current.Request[key] which i then do split(',') if its
I'm wondering if there's a simple way to split a string into an array
Is there a more efficient way to create a string array from Guava's Splitter
Is there a way to split a single HTML page (purely static, HTML +
Is there a way to split a huge xul file into small xul files
I have a data april/2010 to jan/2011 Is there any way to split the
Just wondering if there is a faster way to split a file into N
Is there way to print from Apple and Android mobile browsers via bluetooth. I
Is there way to animate each letter in a word separately, using only CSS

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.