Calling a user-defined function from - efficiency questions

Posted on 2005-05-03
Last Modified: 2008-02-01
Hello Experts,
        I have an efficiency question.   I want to call a user-defined sql-server function from a application.
Is it efficient to simply called a sql command object with text as in :
        sqlcmd = "Select dbo.myFunction"


Is it more efficient to turn each function into a stored procedure (that does the above)?
I know sql server optimises stored procedures but don't know if it could or would optimise a simple select from a function.
If it doesn't make any difference, I would just as soon use the first method as it saves me creating a lot of stored procedures and cluttering up the database.

Any advice would be most appreciated!

Many thanks
Gail HL
Question by:gailhl
    LVL 25

    Accepted Solution

    I don't think SQL server can optimize much on such a small statement, so I would stick with your first option :-)

    Author Comment

    Thank you very much!   Apologies for taking such a long time to close the question ... I got involved in something and lost track.

    Much aprpeciated,
    Gail HL

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now