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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:20:02+00:00 2026-05-30T15:20:02+00:00

I need to write a sql update statement using REPLACE. The string looks like

  • 0

I need to write a sql update statement using REPLACE. The string looks like ‘SE*88*000000001’. I need to replace the number between the two asterisks ‘*’. There is no pattern here other then that number to be replaced is always between two asterisks. Is it possible to use wild cards in this situation?

Appreciate your help.

Thanks!

  • 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-30T15:20:03+00:00Added an answer on May 30, 2026 at 3:20 pm
    ;
    WITH RowSetToUpdate AS (
      SELECT
        acolumn,
        Asterisk1Pos = CHARINDEX('*', acolumn),
        Asterisk2Pos = CHARINDEX('*', acolumn, CHARINDEX('*', acolumn) + 1)
      FROM atable
      WHERE acolumn LIKE '%*%*%'
    )
    UPDATE RowSetToUpdate
    SET acolumn = STUFF(
      acolumn,
      Asterisk1Pos + 1,
      Asterisk2Pos - Asterisk1Pos - 1,
      'replacement_string'
    )
    

    Or if it’s a specific number that is to be replaced, then it would be even simpler:

    UPDATE atable
    SET acolumn = REPLACE(acolumn, '*88*', '*replacement_string')
    WHERE acolumn LIKE '%*88*%'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to update multiple databases with a few simple SQL statement. The databases
I need to rapidly write code to insert/update SQL data. In classic ASP/VBScript I
I need to write a SQL update query. I want to update where workorder=12300000
string sqlQuery = unknown; I need to write a function which receives a sql
I need to write an SQL query to take either from one of two
I need to know how to write a SQL statement for the following senario;
I'm using SQL Server to swap two values in two rows. Let me show:
Requirements need an Update and Insert for 10 million records in Sql Server 2005.
Trying to find the best way to write this SQL statement. I have a
How do I need to write my SQL script to ensure my new column

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.