• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

update query syntax sql server 2008

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
Fordraiders
Asked:
Fordraiders
1 Solution
 
Patrick MatthewsCommented:
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
 
FordraidersAuthor Commented:
Thanks as always
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now