1. Use the Split function from here
http://blog.logiclabz.com/sql-server/split-function-in-sql-server-to-break-comma-separated-strings-into-table.aspx
2. Then you can do it in following way
declare @dummy table(Id int, Name varchar(50))
insert into @dummy
select 1, 'John'
union
select 2, 'Jake'
union
select 3, 'James'
union
select 4, 'Rob'
union
select 5, 'Russel'
union
select 6, 'Alice'
union
select 7, 'Pamela'
declare @ExcludeIds varchar(100)
set @ExcludeIds = '4,5'
select * from @dummy where Id not in (select * from dbo.Split(@ExcludeIds, ','))