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 |
|
mathmax
Yak Posting Veteran
95 Posts |
Posted - 2008-07-16 : 10:50:16
|
| Hello,I've a program that send queries with functions that are not TSQL valid. I should convert those functions so that SQL server understand them. I see two possible approaches:-Convert the functions name on the client side in order to send valid SQL queries to the database.-Create user defined function on the server that redirect to the TSQL functions.The second approach is a bit more simple to deploy, but I wonder if it's less efficient...Here is an example of conversion :alltrim(astring) should be converted to ltrim(rtrim(astring))Which of the above solutions to you advice me?regards,mathmax |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-16 : 10:56:01
|
| i think first option is better so that sql server will always get valid functions for processing.The other functions can be replaced with help of some string manipulation functions available in front end. |
 |
|
|
mathmax
Yak Posting Veteran
95 Posts |
Posted - 2008-07-16 : 11:07:13
|
| Is there a significant difference of performance when SQL server process on valid functions rather than on user defined functions?On the other side, my client machines aren't very powerful and translations of functions could be a bit slow... |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-07-16 : 23:38:39
|
| Should use system functions whenever possible. |
 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-07-17 : 01:38:25
|
| You've also got to consider how/whether the Query Optimizer will take into account the UDF when deciding on the query planJack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
 |
|
|
mathmax
Yak Posting Veteran
95 Posts |
Posted - 2008-07-17 : 08:43:29
|
| Yes it's quite easy because the epxression I have to convert into SQL is parsed on the client side. |
 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-07-19 : 05:07:46
|
| OK , I was thinking more about UDFs within the sql server itselfJack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
 |
|
|
|
|
|