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 |
cogitovn
Starting Member
1 Post |
Posted - 2008-04-18 : 12:05:29
|
I design a table with a column in ntext data. I want to search on this field without differentiate between low case and super case. For example:select Lower(Content) from BookError is: "Argument data type ntext is invalid for argument 1 of lower function."How can I convert case with ntext? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-18 : 13:57:59
|
Have a look at UPDATETEXT() & TEXTPTR() functions. |
|
|
chandan_joshi80
Starting Member
30 Posts |
Posted - 2008-04-19 : 07:34:13
|
declare @t table (RequestId int, Dept int, ADate NTEXT)insert @t select 1001, 1, 'AMIT'union all select 1001, 2, 'SUMTI'union all select 1001, 1, 'NEHA'SELECT LOWER(CAST (ADATE AS VARCHAR(10))) FROM @tLOWER CASE TAKES EXPRESSION THAT implicitly convertible to varchar,SO YOU NEED TO CAST EXPLICITLYchandan Joshi |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-04-19 : 08:40:28
|
Your nText column will may have values that excede your varchar limit.Depends on your collation as to whether or not string comparisons are case sensitive. You can always override the default collation in the query itself:use northwind--case insensitiveselect notes from employees where notes like '%English%' COLLATE Latin1_General_CI_AS--case sensitiveselect notes from employees where notes like '%english%' COLLATE Latin1_General_CS_ASBe One with the OptimizerTG |
|
|
|
|
|