creating an insert update trigger in sql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nav mac
    New Member
    • Dec 2011
    • 12

    creating an insert update trigger in sql

    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_coln ame" instead of "colname". Please help me out to achieve this.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    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.

    Comment

    • nav mac
      New Member
      • Dec 2011
      • 12

      #3
      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.

      Comment

      Working...