How can we separate arabic names from a column in SQL Server 2012?

后端 未结 1 1817
渐次进展
渐次进展 2020-12-22 09:41

How to separate the arabic names from the column of a table in SQL Server 2012

I have input an image of the table in this it have arabic and English I need

相关标签:
1条回答
  • 2020-12-22 09:57

    Filter on Arabic strings via using like N'%[أ-ي]%'.

    Demo:-

    Create table #Emp
    (id int ,
    name nvarchar(100))
    
    insert into #Emp values (1 , 'Ahmed Abdelqader')
    insert into #Emp values (2 , N'أحمد عبد القادر')
    
    select * from #Emp
    where name like N'%[أ-ي]%'
    

    Result:-

    id  name
    2   أحمد عبد القادر
    

    Update:-

    If you need to get the Arabic words ONLY, Use the next code:-

    name like N'%[أ-ي]%' and name not like N'%[a-z]%'
    
    0 讨论(0)
提交回复
热议问题