What error its throwing -- Query looks fine and it should run -- check on alias name
WHEN EXISTS (SELECT 1
where source = 'B')
--- whats is 'bs' and 'dss' here run simple as provided above in same database where table exists.
if referring other database then use database_name..table_name