New to using SQL server management studio...
Just trying to filter my table results to show only records that have (deceased) in them...
So far I have
select SURNAME, count(SURNAME) from [dbo].[blahblah] group by SURNAME order by SURNAME
select trim(translate(cast(GUAR_PHONE as string), '0123456789', ' ')),GUAR_PHONE
WHERE trim(translate(cast(GUAR_PHONE as string), '0123456789', ' '))<>'';
If you are looking for a string such as
'deceased', then you would use
select b.* from dbo.blahblah b where b.guar_phone like '%deceased%';
This seems to address the question at the beginning of the post. I have no idea what the code is supposed to be doing.
In SQL Server, if you just want to see if there are any non-numbers in the string, you would do:
where b.guar_phone like '%[^0-9]%'