I want to update a field in a table (tName_Security.EXPIRATION_DATE) based on external conditions that I have used to build a field in a view (vDBChk_BadSecurityDates_Active.NewExpirationDate).
So far I have a stored procedure designed to process this update, but something is wrong. Since the view does not have a record matching every entry in the table, the ones that aren't in the view are being set to NULL.
I only want the recs in table which match the view to be changed.
Here is what I have so far:
Any help is appreciated. TIA!
So far I have a stored procedure designed to process this update, but something is wrong. Since the view does not have a record matching every entry in the table, the ones that aren't in the view are being set to NULL.
I only want the recs in table which match the view to be changed.
Here is what I have so far:
Code:
UPDATE tName_Security
SET EXPIRATION_DATE =(
SELECT NewExpirationDate
FROM vDBChk_BadSecurityDates_Active
WHERE tName_Security.ID = vDBChk_BadSecurityDates_Active.ID
)
Any help is appreciated. TIA!