I have the following code to update docPath
field, I need help on how to check the existence of a file before running the update statement or update only if the file exist in the directory otherwise skip
INSERT INTO DocPath(itemId,docPath)
SELECT
itemId,
'\\ABC-SERVER\Data\PRODUCTION\VAULT\2500000 - 2599999 \PDF\''
+[WITESTCO].[dbo].[WIITEMX].[itemId]
+'.pdf' as docPath
FROM [WITESTCO].[dbo].[WIITEMX]
WHERE
itemId like '2500%' or itemId like '2501%' ;