select 'and (' +
case when c.is_nullable = 1 then '(c.' + c.name + ' is null and i.' + c.name + ' is null) or ' else '' end +
'c.' + c.name + ' = i.' + c.name + ') '
from sys.objects o
inner join sys.columns c
on o.object_id = c.object_id
where o.object_id = object_id('<table_name>')
and c.name not in (<column name>)
order by c.column_id