You could do something like this (I changed @name to @names):
DECLARE @names varchar(max);
WITH names(n) AS
(
SELECT Name
FROM dbo.iNamesExcel$
FOR XML PATH('')
)
SELECT @names=CHAR(39)+LEFT(n,LEN(n)-1)+CHAR(39)
FROM names
Then, in your DSQL change your and displayName =
to
and displayName IN ( @names )
Hope that makes sense. Let me know if you need clarification.
-- Itzik Ben-Gan 2001