Solved

Update on a Join Statement

Posted on 2014-04-10
2
171 Views
Last Modified: 2014-04-21
I'm having a hell of a time with a seemingly easy statement. I have verified all the tables and fields are correct

use pbj_2be

UPDATE ACH_1114b 
SET [Status] = 'en'
inner JOIN dbo.[tblBNK_GRP_ENT]
ON ACH_1114b.[account number] = tblBNK_GRP_ENT.ACCT 

WHERE ACH_1114b.[Status]='EN' AND tblBNK_GRP_ENT.GroupedPmts = 0 

Open in new window


the error i get is Msg 156, Level 15, State 1, Line 9
Incorrect syntax near the keyword 'inner'.
0
Comment
Question by:damixa
2 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 39992783
UPDATE t1
SET [Status] = 'en'
FROM ACH_1114b AS t1
INNER JOIN dbo.[tblBNK_GRP_ENT] AS t2
ON t1.[account number] = t2.ACCT 
WHERE t1.[Status]='EN' AND t2.GroupedPmts = 0 

Open in new window

0
 

Author Closing Comment

by:damixa
ID: 40012668
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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.

910 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

23 Experts available now in Live!

Get 1:1 Help Now