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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:22:23+00:00 2026-05-23T10:22:23+00:00

For example Input: 0123BBB123456 Output: 123456 Input: ABC00123 Output: 00123 Input: 123AB0345 Output: 0345

  • 0

For example

Input: 0123BBB123456  Output: 123456
Input: ABC00123       Output: 00123
Input: 123AB0345      Output: 0345

In other words, the code should start stripping characters from the right and stop when a character that is no 0-9 is encountered.

I have to run this agains several millions of records, so I am looking for an efficient set based approach, not a cursor approach that performs substring functions in a loop for each record.

I am having issues trying to format this for reading. Give me a few minutes.

Frustrating…I think that the browser that I am using, IE6 (mandated by my company) is making this challenging. This site doesnt work well with 6.

  • 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-23T10:22:23+00:00Added an answer on May 23, 2026 at 10:22 am

    How about;

    ;with test(value) as (
        select '0123BBB123456' union
        select 'ABC00123' union
        select '123AB0345' union
        select '123'
     )
     select
        value, 
        right(value, patindex('%[^0-9]%', reverse('?' + value)) - 1)
     from test  
    
    
    0123BBB123456   123456
    123             123
    123AB0345       0345
    ABC00123        00123
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Example input: SERVER_NAME=server1 PROFILE_NAME=profile1 ... Example output: SERVER_NAME=server3 PROFILE_NAME=profile3 ... This file will use
For example : input = 360 seconds output = 6 minutes input = 86400
For example Input <url wiki=https://wiki.archlinux.org/index.php/Main_Page forums=https://bbs.archlinux.org/> Desired output <url wiki=https://wiki.archlinux.org/index.php/Main_Page forums=https://bbs.archlinux.org/> Here's a sample
For example If the user gives input as a + b, process should be
Input: $string = this-is-just-an--example Output: this is just an-example Tried various things centered around
Example Input: SMK SUNGAI PUNAI My Code: $school = 'SMK SUNGAI PUNAI'; echo ucwords(strtolower($school));
My Problem is, that this code just works with tiny input-strings The code should
Example input: 8/23/2008 (single digit day/month do not get leading zeros) Desired output: 2008-08-23
How can i find the language for a given locale? Example: input: en_US output:
Example Input = 1.1.0.1 Expected output = 1.101

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.