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 |
|
nvakeel
Yak Posting Veteran
52 Posts |
Posted - 2008-02-05 : 08:59:13
|
Hello,I have a select query which uses Trim function..likeSelect * from Tbl1 where ltrim(name) = @name.I am using this trim functions very often, the perfomance is hitting low.... can anyone giv me a permanent solution avoiding the trim functions.It would be of great help.Thanks. |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-02-05 : 09:11:19
|
| Trim the data when you insert it into the database. |
 |
|
|
nvakeel
Yak Posting Veteran
52 Posts |
Posted - 2008-02-05 : 09:22:06
|
| I am Using this select query in SP so I need a query to compensate the trim functions. |
 |
|
|
Ifor
Aged Yak Warrior
700 Posts |
Posted - 2008-02-05 : 10:41:52
|
The following will allow index scans:SELECT *FROM Tbl1WHERE [name] LIKE '%' + @name but will allow characters other than space at the beginning. |
 |
|
|
|
|
|