Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

update query syntax sql server 2008

Posted on 2011-09-26
2
Medium Priority
?
463 Views
Last Modified: 2012-05-12
sql server 2008 r2

Trying to use an update query update a field in the second table based on a join.

UPDATE CRS_GisXrefExt_staging INNER JOIN CRS_GisXrefExt ON [CRS_GisXrefExt_staging].[item] = [CRS_GisXrefExt].[item] SET [CRS_GisXrefExt].[spin] = [CRS_GisXrefExt_staging].[spin]

incorrect syntax new  "INNER"

Thanks
fordraiders

0
Comment
Question by:fordraiders
[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 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 36599185
That's syntax used by Access's Jet SQL.  In SQL Server's T-SQL:

UPDATE CRS_GisXrefExt
SET spin = s.spin
FROM CRS_GisXrefExt c INNER JOIN
    CRS_GisXrefExt_staging s ON c.item = s.item

Open in new window

0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 36599670
Thanks as always
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

618 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