364,111 Members | 2129 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

creating an insert update trigger in sql

nav mac
P: 12
Hello all,
I have a select query which uses many lower() functions and due to which the performance and the execution speed of the query is real bad so I want to add an
additional column to hold a lowercase version. Say,my column name is "colname". The new column "lower_colname". I should Set
up an insert-update trigger that sets lower_colname = lower(colname).
Then set up the index against "lower_colname" instead of "colname". Please help me out to achieve this.
Feb 14 '12 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 5K+
P: 6,668
Show us the query because I really doubt the LOWER function is what's causing the slowdown. Did you take a look at the execution plan to determine what's actually slowing it down?

Also, I'm not sure if you're aware of this but SQL Server ignores case by default.
Feb 14 '12 #2

nav mac
P: 12
Thanks a lot rabbit. I figured out that the query has many AND conditions , not contains conditions even if they are not necessary in that criteria....so got rid of them. Now my query just takes few seconds for the execution.

Thanks once again.
Feb 16 '12 #3

Post your reply

Help answer this question



Didn't find the answer to your Microsoft SQL Server question?

You can also browse similar questions: Microsoft SQL Server