[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

SQL 2008 Linked Table UPDATE with INNER JOIN syntax help.

Posted on 2010-09-23
1
Medium Priority
?
540 Views
Last Modified: 2012-05-10
Hello Group;
I am trying to update a Linked Server table with the following query but have varying errors.
Please let me know what the heck I am doing wrong here.  Because it is a linked server, the tables initially need to be called out in Four Dot notation.

UPDATE [VANTAGE TEST].[MFGSYS].[PUB].[PartPlant]
SET DaysOfSupply = 10
FROM(SELECT DaysOfSupply FROM [VANTAGE TEST].[MFGSYS].[PUB].[PartPlant]
INNER JOIN [VANTAGE TEST].[MFGSYS].[PUB].[Part]
ON PartPlant.PartNum = Part.PartNum WHERE Part.TypeCode ="P")

Goal: Update the PartPlant.DaysOfSupply with a value of 10.  I get errors like Cannot update VarChar field with Integer, but when I try to put the value of 10 in quotes I get other errors.

Thanks for any help!
GLH
0
Comment
Question by:PCI-INTL
[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
1 Comment
 

Accepted Solution

by:
PCI-INTL earned 0 total points
ID: 33749714
Got it!  Just had to change the "ON" portion reverse the table names and use single quotes.

UPDATE [VANTAGE TEST].[MFGSYS].[PUB].[PartPlant]
SET DaysOfSupply = 14
SELECT DaysOfSupply FROM [VANTAGE TEST].[MFGSYS].[PUB].[PartPlant]
INNER JOIN [VANTAGE TEST].[MFGSYS].[PUB].[Part]
ON Part.PartNum = PartPlant.PartNum WHERE Part.TypeCode = 'P'
GO
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

656 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