Solved

SQL Update Querry

Posted on 2013-01-14
5
169 Views
Last Modified: 2013-01-16
Can someone please tell me what update command I need in order to do this? I will need to do a mass change to all records with the following operation ID "1AC_"
Where Description is "RECIEVING" changed to read "RECEIVING / PRELIMINARY INSPECTION"
There are probably over 3 thousands records so I was wondering if someone could please tell me a querry to update the description on the table for specific records (operation ID "1AC_" )

Here is the table:
table
0
Comment
Question by:pauledwardian
  • 2
  • 2
5 Comments
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 333 total points
ID: 38777116
Update tablename

set description='RECEIVING / PRELIMINARY INSPECTION'
where Operation_Id='1AC_'
and description = 'RECIEVING'

try this
let us know if any problem
0
 

Author Comment

by:pauledwardian
ID: 38778508
Thank you for your responce.
The Operation_Id always starts with "1AC_" but it has other characters attached to it like:

1AC_692545-17/-18
1AC_3886225
1AC_319545
 ...

And also the description is either like "RECEIVING:" (with collon) and in some cases "RECEIVING" (without the collon).

Can you please help?

Thank you,
Paul
0
 
LVL 31

Accepted Solution

by:
awking00 earned 167 total points
ID: 38778595
Update tablename

set description='RECEIVING / PRELIMINARY INSPECTION'
where Operation_Id like '1AC_%'
and description like 'RECEIVING%'
0
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 333 total points
ID: 38782225
Update tablename

set description='RECEIVING / PRELIMINARY INSPECTION'
where Operation_Id like '1AC_%'
and ( description = 'RECIEVING' OR description = 'RECIEVING:' )
0
 

Author Closing Comment

by:pauledwardian
ID: 38784593
Thank you all
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Backup & Restore 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.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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.

758 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

22 Experts available now in Live!

Get 1:1 Help Now