Solved

SQL question

Posted on 2013-01-04
4
271 Views
Last Modified: 2013-01-04
How do I structure this SQL to update a record?

UPDATE IHPS_case_note SET safety_plan_revision_request = 'xxxxxxxx'

 INNER JOIN ihps_case ON ihps_case.ID = ihps_case_note.fk_caseID
 INNER JOIN ihps_create_log ON ihps_create_log.ID = ihps_case.FK_createlogID
 WHERE DHS_evaluationID = 11111 AND ihps_create_log.incremental = 1
0
Comment
Question by:HLRosenberger
  • 2
4 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 250 total points
ID: 38745386
UPDATE IHPS_case_note
SET safety_plan_revision_request = 'xxxxxxxx'
FROM IHPS_case_note
    INNER JOIN ihps_case ON ihps_case.ID = ihps_case_note.fk_caseID
    INNER JOIN ihps_create_log ON ihps_create_log.ID = ihps_case.FK_createlogID
WHERE DHS_evaluationID = 11111 AND ihps_create_log.incremental = 1
0
 
LVL 26

Assisted Solution

by:Chris Luttrell
Chris Luttrell earned 250 total points
ID: 38745387
Like this:
UPDATE IHPS_case_note 
SET safety_plan_revision_request = 'xxxxxxxx'
FROM IHPS_case_note 
 INNER JOIN ihps_case ON ihps_case.ID = ihps_case_note.fk_caseID 
 INNER JOIN ihps_create_log ON ihps_create_log.ID = ihps_case.FK_createlogID
 WHERE DHS_evaluationID = 11111 AND ihps_create_log.incremental = 1

Open in new window

0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 38745435
Thank so much!
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 38745446
Thanks for the split.  Good luck with your project. -Jim
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

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.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
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.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

685 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