Hi all, We have a UDF which is returning the result in 2 seconds. When i copy the code(just two select stmts) in the UDF and hardcode the values, and execute these two stmts in QA its taking 0 sec to execute.[ when I looked at the execution plans, it is using the clustered index seeks] so far so good. But when i pass the parameters on to the UDF ,and call it from a select stmt, the execution plan shows that its using a constant scan instead of the indexe seek. resulting in 2 seconds of execution time. i was wondering why it using a constant scan when called as a UDF while its actually using index seeks when i seperately execute the two select stmts in QA. Any help will be appreiated Regards.