[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

SQL Server update statement

I need to update a part of a field with a value.

If a field has a value of ListID = xValue
and field.title = 'This is more stuff $4.125 Million U'

and  ListPrice gets updated from 4125000.00 to 3975000.00
I need the otehr field to be updated to

field.title = 'This is more stuff $3.975 Million U' where listid = xValue

0
lrbrister
Asked:
lrbrister
  • 3
1 Solution
 
David ToddSenior DBACommented:
Hi,

Please post a create statement for your table.

How are you updating things at present? Via a procedure or direct from code?

Regards
  David
0
 
lrbristerAuthor Commented:
dtodd
blah...blah...blah...
begin
update tblListingInput
set ListPrice=@price
where ListID=@ListID
end

I then need to replace that string in tblMarketing.adTitle where ListID = @ListID and mktID = @mktID
0
 
lrbristerAuthor Commented:
and Via a procedure
0
 
dqmqCommented:
Not sure what  you are asking.  Seems like you want to change the SQL, not update the table.
0
 
lrbristerAuthor Commented:
Let me try and clarify...

One tabel stores a dollar figure that is used in many places.

Another table stores an Advertising Title that is used specifically for a partivular issue(s)

When the asking sale price is changed I'm going to updae this Advertisint Title for the listing.

HOWEVER...everthin in that Ad Title can be edited after the first "build".  

All I want to do is grab the string out of the middle that pertains to the dollar amopunt and update THAT with the new sales price.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now