Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'LIKE' keyword is not working in sql server 2008

I have bulk-data in SQL-Server table. One of the fields contains following data :

'(اے انسان!) کیا تو نہیں جانتا)' 

Tried:

SELECT * from Ayyat where Data like '%انسان%' ;

but it is showing no-result.

like image 858
Baqer Naqvi Avatar asked Feb 04 '14 11:02

Baqer Naqvi


People also ask

Is not like in SQL Server?

The NOT LIKE operator in SQL is used on a column which is of type varchar . Usually, it is used with % which is used to represent any string value, including the null character \0 . The string we pass on to this operator is not case-sensitive.

How do I use not like in SQL?

SQL not like statement syntax will be like below. SELECT column FROM table_name WHERE column NOT LIKE pattern; UPDATE table_name SET column=value WHERE column NOT LIKE pattern; DELETE FROM table_name WHERE column NOT LIKE pattern; As an example, let's say we want the list of customer names that don't start with 'A'.

How do you declare a constant in SQL Server?

A constant is a symbol that represents a specific data value. SQL constants can be used in queries and expressions. They can be used any number of times in a query, but the value is only materialized once per query execution.

How do you find a constant in SQL?

You can search sys. sql_modules for definition LIKE N'%115%' : SELECT sm. object_id, OBJECT_NAME(sm.


1 Answers

Plese use N before string if language is not a english:

  SELECT * from Ayyat where Data like N'%انسان%' ;
like image 160
jainvikram444 Avatar answered Oct 27 '22 18:10

jainvikram444