I am fairly new to SQL Server and using SQL 14 Developer. I know what I want to accomplish but I'm not sure how to accomplish it.
This involves 2 table, 'tblProperty' and 'SQHD_PropHeader_Work'.
The pertinent field in 'tblProperty' are
MuniCode small int
The combination of Muni and LotBlock is Unique in both tables
For every MuniCode, Lotblock combination that exists is tblProperty a select statement to join them would look like this:
SELECT dbo.SQHD_PropHeader_Work.MuniCode, dbo.SQHD_PropHeader_Work.LotBlock, dbo.SQHD_PropHeader_Work.ControlNumber,
FROM dbo.SQHD_PropHeader_Work LEFT OUTER JOIN
dbo.tblProperty ON dbo.SQHD_PropHeader_Work.MuniCode = dbo.tblProperty.Muni AND dbo.SQHD_PropHeader_Work.LotBlock = dbo.tblProperty.LotBlock
I want to update the 'OldControlNumber' field in 'tblProperty' with the corresponding 'ControlNumber' field in 'SQHD_PropHeader_Work
I don't know how to create the update query to accomplish this. Is it possible.