Solved

update query syntax sql server 2008

Posted on 2011-09-26
2
455 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
2 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query questions 2 36
Query to return total 6 19
SQL Insert parts by customer 12 35
How to search for strings inside db views 4 28
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

831 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