Solved

SQL 2008 Linked Table UPDATE with INNER JOIN syntax help.

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

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

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 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