User Tools

Site Tools


microsoft:microsoft_sql_server:sql:tables:update_table_with_join_to_another_table

Microsoft - Microsoft SQL Server - SQL - Tables - Update Table with join to another Table

CREATE PROCEDURE Reset_Failed_Processing_Vendor_Records
AS
UPDATE  ztV SET 
ztV.zReadyForReview = NULL, 
ztV.zReadyForReviewOn = NULL, 
ztV.zConfirmed = NULL, 
ztV.zConfirmedOn = NULL, 
ztV.zConfirmedBy= NULL
FROM    dbo.ztVenDedup AS ztV
INNER JOIN dbo.Vendor_Failure_Groups AS Ven
ON Ven.partner1=ztV.PARTNER 
AND Ven.zCheckWithinGroup=ztV.zCheckWithinGroup

UPDATE  ztV SET 
ztV.zField05 = Ven.Updated_Value
FROM    dbo.ztStructureCleansing AS ztV
INNER JOIN dbo.Address_Cleansing_Fix2 AS Ven
ON Ven.Keyfield=ztV.Keyfield
WHERE Ven.Field_to_be_updated  = 'zfield05'
AND ztV.zObject = Ven.[SOURCE]
microsoft/microsoft_sql_server/sql/tables/update_table_with_join_to_another_table.txt · Last modified: 2021/08/05 10:54 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki