When a SQL statement uses an EXISTS / NOT EXISTS then there needs to be a WHERE clause in it as well.
Not compliant:
e.g.
SELECT *
FROM sys.[databases] AS [sd]
WHERE EXISTS (SELECT 1
FROM [sys].[master_files] AS [mf])
Compliant:
e.g.
SELECT *
FROM sys.[databases] AS [sd]
WHERE EXISTS (SELECT 1
FROM [sys].[master_files] AS [mf]
WHERE [mf].[database_id] = [sd].[database_id])
If the statement would be an update or delete instead of a select there would be to many rows deleted.
Thank you very much.
Regards,
Chris