Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
joseph2078
Starting Member
1 Post |
Posted - 2009-08-19 : 11:11:08
|
| Hi All,I am using Like statement in the query to retrieve result but the problem is when i am passing value in lower case in the query using like statement in query, it dosen't return record.Below is the query:Select * from System where Asset like 'gr%'Dosen't return record But if i passSelect * from System where Asset like 'GR%'then i get the result.Can you please give me any solution so i can pass value in upper or lower case and it should return result.Thanks in AdvanceJoseph |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-08-19 : 11:20:58
|
| Select * from System where Asset like 'GR%' or Asset like 'gr%'Select * from System where UPPER(left(Asset,2)) = 'GR'Jim |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-08-19 : 11:22:22
|
It seems you have a case sensitive collation for the column.You can do as jimf demonstrated or COLLATE the column on the fly when querying. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-08-19 : 11:33:17
|
| Check this for detailed informationhttp://vyaskn.tripod.com/case_sensitive_search_in_sql_server.htm |
 |
|
|
|
|
|