I have the "👍" emoji stored as a message in my database. When I execute my store procedure to retrieve records where
select top 10 *
from t_MemberApp_PushNotifications
where contactID = 10930547
and pushMessage <> ''
order by 1 desc
It doesn’t display the data when only emoji is present. As you can see the attached images.
I attempted to understand the issue by referring to the provided link, and you can utilize it to address my concern on a SQL Fiddle.
Fiddle Link
>Solution :
Use N for indicating UNICODE string
Select top 10 * from t_MemberApp_PushNotifications
where contactID = 10930547 and pushMessage <> N'' order by 1 desc
You can use len()
Select top 10 * from t_MemberApp_PushNotifications
where contactID = 10930547 and LEN(pushMessage) >0 order by 1 desc

