Solved

Help with Find / Replace sql query

Posted on 2008-06-26
1
1,026 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
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
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.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now