In SQL Server 2008 R2, I'm trying to delete records from one table that match records in another table based on the values in 4 fields. I've tried:
FROM dbo.tbl_Readings_Tanks as TR
INNER JOIN zz_Staging_Tanks
ON (TR.Reading_Type_ID = zz_Staging_Tanks.Reading_Type_ID)
AND (TR.Prod_ID = zz_Staging_Tanks.Prod_ID)
AND (TR.docDate = zz_Staging_Tanks.docDate)
AND (TR.Equip_ID = zz_Staging_Tanks.Equip_ID)
But this returns an error :
Incorrect syntax near '*' and underlines as indicated.
There is an unique index in tbl_Readings_Tanks on those 4 columns.
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!