Hello all,

Are UDFs written only on SQL Analyser in within the SQL?
Can we use them in programming code?How to use them in the code?
What are the actual benefits of UDFs?
We can write the method in the code and connect to the database and execute which yeilds same results! Then why are UDFs used for?
Can someone solve my doubts pls.

Thankyou.

1- Depends on your version but it doesn't make any difference.
2- Yes calling UDF like SP, search how to use it in .net
3- Pre-compiled queries, you can use some logic (splitting strings, some calculations, etc..)
4- In some situations you'd better to write UDF than programming code.
haa, discuss me if you're convinced.

1- Depends on your version but it doesn't make any difference.
2- Yes calling UDF like SP, search how to use it in .net
3- Pre-compiled queries, you can use some logic (splitting strings, some calculations, etc..)
4- In some situations you'd better to write UDF than programming code.
haa, discuss me if you're convinced.

Can you tell me few examples fr the situations u said.

If you have string like that in table "lmlmlaa,lmlmlaa, lmlmlaa, lmlmlaa" and need to return it as table
ID text
1 lmlmlaa
2 lmlmlaa
3 lmlmlaa
4 lmlmlaa
and you may also do some operation on this table, what do you see is to handle this in C# or UDF?

commented: tnx fr ur time +1

If you have string like that in table "lmlmlaa,lmlmlaa, lmlmlaa, lmlmlaa" and need to return it as table
ID text
1 lmlmlaa
2 lmlmlaa
3 lmlmlaa
4 lmlmlaa
and you may also do some operation on this table, what do you see is to handle this in C# or UDF?

So, basically we use these UDFs to retrieve /create/add data from the tables in the database within the query analyser of the database.
We can only make use of this data only by passing it into another table created exclusively to store the result and later get it displayed through the normal code in the program.
Pls correct me if i am wrong and missing something..

thanks..

Yes :) you're right

Yes :) you're right

Thank you .. that is all what i wanted to know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.