Solved

Help with Find / Replace sql query

Posted on 2008-06-26
1
1,033 Views
Last Modified: 2012-06-21
my query is below.  it works in the sense that it displays a correct list of Part Numbers that have changed.  however, when i re query the table to verify the changes, the table hasn't been updated.

i'm assuming i need an UPDATE somewhere in my query... i'm just not sure where.
thanks.
SELECT REPLACE(dbo.mytable.[Part Number],'R','K')
FROM dbo.mytable
WHERE [Part Number] like 'DV%R[0-9]%'

Open in new window

0
Comment
Question by:zephyr_hex (Megan)
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 21878128
update myTable
set [part number] = REPLACE([Part Number],'R','K')
WHERE [Part Number] like 'DV%R[0-9]%'
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question