Solved

changing descriptions

Posted on 2012-03-10
8
257 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:Amanda Walshaw
Comment Utility
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
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.

 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
worked well
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

762 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

10 Experts available now in Live!

Get 1:1 Help Now