?
Solved

update query syntax sql server 2008

Posted on 2011-09-26
2
Medium Priority
?
461 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

764 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