UDF can't make permanent changes to server environments while SP's can change some of them - SQL Server 2005 / 2008

Posted on 2009-04-19
Last Modified: 2012-05-06

Can you please explain me in simple terms and examples :

UDF can't make permanent changes to server environments while SP's can change some of them - SQL Server 2005 / 2008

Question by:milani_lucie
    LVL 30

    Expert Comment

    what's the actual question/issue?

    Author Comment

    This is one of the difference  between UDF and SP
    LVL 25

    Accepted Solution

    Simply put, it means that you cannot alter server settings or configurations within a UDF, while some element of this is permissible within a stored procedures..

    For e.g. you cannot have the following statements within a UDF (SET keyword in UDFs can only be used to assign values to variables), but this is allowed within a stored procedure..


    The statement above changes the way literal date values are interpreted by the server.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
    INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    733 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

    22 Experts available now in Live!

    Get 1:1 Help Now