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
Solved

update query syntax sql server 2008

Posted on 2011-09-26
2
457 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

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 8 51
SQL Server tables join on parse list 6 33
shrink table after huge delete 2 13
Substring works but need to tweak it 12 6
I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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