Solved

Microsoft, SQL, 2005, Update Script help

Posted on 2008-10-17
4
512 Views
Last Modified: 2010-04-21
I want to update type of bill from 738 to 731 where the visit owner equals 6

Started it but its not going well ... any help is appreciated.

UPDATE PatientVisitFiling pvf FROM
INNER JOIN PatientVisit pv ON pvf.PatientVisitId = pv.PatientVisitId
SET pvf.TypeOfBill = '731' WHERE pv.VisitOwnerMId = '6'
0
Comment
Question by:Jeff S
[X]
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
4 Comments
 
LVL 22

Accepted Solution

by:
dportas earned 200 total points
ID: 22743808
UPDATE PatientVisitFiling
SET TypeOfBill = '731'
WHERE EXISTS
(SELECT 1
 FROM PatientVisit pv
 WHERE pv.PatientVisitId = PatientVisitFiling.PatientVisitId
  AND pv.VisitOwnerMId = '6');
0
 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 200 total points
ID: 22743828
UPDATE PatientVisitFiling
SET TypeOfBill = '731'
FROM PatientVisitFiling pvf INNER JOIN
      PatientVisit pv ON pvf.PatientVisitId = pv.PatientVisitId
WHERE pv.VisitOwnerMId = '6'
0
 
LVL 9

Assisted Solution

by:vavjeeva
vavjeeva earned 100 total points
ID: 22743851
try this .. it should work

UPDATE PatientVisitFiling SET TypeOfBill = '731'  FROM PatientVisitFiling pvf
INNER JOIN PatientVisit pv ON pvf.PatientVisitId = pv.PatientVisitId
WHERE pv.VisitOwnerMId = '6'
0
 
LVL 7

Author Closing Comment

by:Jeff S
ID: 31507236
Split points to be fair ....  wish i could give all full credit
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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

626 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