I altered the table and rewrote it as
create table customer(
customerid int identity(1,1) primary key,
customername varchar(50),
cemail varchar(30) unique,
sound varchar(50)
);
for this table i created a on insert trigger
something like
create trigger setsound on dbo.customer
for
insert
as
declare @customerid int;
declare @customername varchar(50);
declare @sound varchar(50);
select @customerid=customerid from inserted;
select @customername=customername from inserted
set @sound=(select soundex(@customername) from customer where customerid=@customerid)
update customer
set sound=@sound where customerid=@customerid;
now what i do is i rewrite the procedure
create procedure fuzziness(@customername varchar(50))
as
declare @sound varchar(50);
set @sound=(select sound from customer where customername=@customername);
select * from customer where sound=@sound;
This gives me a better co related output