Solved

Help with Find / Replace sql query

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

821 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