Sql Server Server environment UDF Vs. SP

  • Hi ,

    UDFs can't change the server environment or your operating system environment.

    SPROCs can change server or operating system environment variables.

    How can we prove this.

    please suggest.

    Thanks,

  • There's no need for proof. It's right there in the SQL Server documentation as provided by Microsoft, the people who wrote the software.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • That's certainly true for T-SQL UDFs.

    Technically speaking a CLR UDF could affect pretty much anything it wanted, it would just be a bad idea as you have no guarantee of transactional consistency, order of execution etc. (hence why it's explicitly prevented in T-SQL)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply