declare @t table (sn sysname null); insert into @t exec xp_cmdshell 'hostname'; select * from @t where sn = @@servername;
select cast(sn as varbinary(100)) as x, cast(@@servername as varbinary(100)) as y from @t