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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Lower function slows down the query

Author  Topic 

PoojaChugh
Starting Member

1 Post

Posted - 2009-05-05 : 06:35:35
We are facing low down time if we use LOWER method in our SQL query.
Here is the query :
select acct.record_id, acct.email, acct.title, acct.fname, acct.lname, acct.address1, acct.address2, acct.address3, acct.city, acct.state, acct.country, acct.zip, acct.phone,
acct.campaign_source, acct.site_source, acct.passwd, acct.secondary_specialty, acct.main_activity, acct.professional_qualification, acct.company, acct.admin, acct.cookie_seq,
acct.place_id, acct.field_id, acct.position_id, acct.field_other, acct.main_activity_other, acct.place_other, acct.position_other, acct.specialty_other, acct.pro_qual_other,
acct.secondary_specialty_other, acct.creation_date, acct.last_modified, acct.modified_by, acct.last_visit, acct.textonly, acct.user_id, acct.internal_account_flag,
acct.concurrency, acct.jpt_user_flag, acct.is_activated, acct.term_agreement_flag, acct.comment_term_flag, ISNULL(spec.field_id, '0') as real_field_id from
Reg_Data.tango_client.fields spec INNER JOIN Reg_Data.tango_client.fields f ON spec.field_id = f.categ RIGHT OUTER JOIN Reg_Data.dbo.vAccounts acct ON f.field_id = acct.field_id
where LOWER(email) = 'abc@yahoo.com'

Our requirement is : While Login process we want to allow mix case username.
Lets say user has registered with "abc@yahoo.com" and while Login he should be allwed if he gives :
1.abc@YAHOO.com
2.ABC@yahoo.com
3.AbC@Yahoo.COM

and so on..

How we are doing : First converting the value which user has provided into Lower case and then fetch Lower case of email if drom DB and then comparing both Lowered case values.

But this Lower function is taking too long to execute.

Any input on this?

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-05-05 : 07:11:58
- use case insensitive collation or
- store data coming from user input directly in lower case

Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -