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
Solved

changing descriptions

Posted on 2012-03-10
8
262 Views
Last Modified: 2012-08-13
I have been given a field that I need to change a description from

Economy Funerals NSW Asset Purchases Cle
to
Value Funerals NSW Asset Purcashes Cle

There are over 500 entries, I need to change the word Economy to Value
what is the sql syntax to do this.
0
Comment
Question by:Amanda Walshaw
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 37705777
UPDATE table
SET fieldname = "Value Funerals NSW Asset Purcashes Cle"
WHERE fieldname = "Economy Funerals NSW Asset Purchases Cle"
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 37705780
where the word table needs to e the name of your table and the word fieldname needs to be the name of the field your changing
0
 
LVL 25

Expert Comment

by:jogos
ID: 37706440
See update of Neilsr, but with building an update always try if your where-clause is correct by trying it in a select. OK here it looks as if it is very specific, but a good habbit makes you won't get surprised by an update where you forgot a crucial filter.

select * from table
WHERE fieldname = "Economy Funerals NSW Asset Purchases Cle"
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:Amanda Walshaw
ID: 37706682
no sorry there are over 500 of the chart of accounts all different descriptions
example of number of descriptions
Economy Funerals NSW Trade Debtors Colle
Economy Funerals NSW Plant & Equipment I
Economy Funerals NSW Asset Sale Proceeds
Economy Funerals NSW Asset Purchases Cle
Economy Funerals NSW Prov Depr - Plant &
Economy Funerals NSW Accrued Charges Inv
Economy Funerals NSW Preservation InvoCa
Economy Funerals NSW Electronic Notices

To

Value Funerals NSW Trade Debtors Colle
Value Funerals NSW Plant & Equipment I
Value Funerals NSW Asset Sale Proceeds
Value Funerals NSW Asset Purchases Cle
Value Funerals NSW Prov Depr - Plant &
Value Funerals NSW Accrued Charges Inv
Value Funerals NSW Preservation InvoCa
Value Funerals NSW Electronic Notices
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37707211
A small variation (no points please):
UPDATE YourTableName
SET YourColumnName = REPLACE(YourColumnName, 'Economy', 'Value')
WHERE fieldname LIKE 'Economy Funerals NSW%'
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 37707212
This should be a safer:
UPDATE YourTableName
SET YourColumnName = 'Value' + SUNSTRING(YourColumnName, 8, LEN(YourColumnName) - 7)
WHERE fieldname LIKE 'Economy Funerals NSW%'
0
 

Author Comment

by:Amanda Walshaw
ID: 37707449
UPDATE YourTableName
SET YourColumnName = 'Value' + SUNSTRING(YourColumnName, 8, LEN(YourColumnName) - 7)
WHERE fieldname LIKE 'Economy Funerals NSW%'

note sunstring is not recognizable, i think you mean substring


i
0
 

Author Closing Comment

by:Amanda Walshaw
ID: 37707450
worked well
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

856 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