?
Solved

Update on a Join Statement

Posted on 2014-04-10
2
Medium Priority
?
176 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
[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
2 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 2000 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

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!

Question has a verified solution.

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

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.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

770 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