Solved

SQL 2008 Linked Table UPDATE with INNER JOIN syntax help.

Posted on 2010-09-23
1
533 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
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

In this article I will describe the Detach & Attach 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.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now