THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Greg Low (The Bit Bucket: IDisposable)

Ramblings of Greg Low (SQL Server MVP, MCM and Microsoft RD) - SQL Down Under

Things I learned today: Calling a scalar UDF with EXEC

This blog has moved! You can find this content at the following new location:

Published Saturday, August 13, 2011 6:52 PM by Greg Low

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



a.m. said:

Okay, but... Why?

August 13, 2011 9:54 AM

Greg Low said:

Hi Adam,

Only one I can think of off the top of my head is that it makes it easier to call a function while specifying the execution context from the client, without having to explicitly use EXEC AS and then REVERT before calling ie: you could do:

EXEC @ReturnValue = dbo.SayHello N'Greg' WITH EXECUTE AS Fred;

I don't doubt that something else will occur to me down the track :-)

August 15, 2011 6:54 PM

Leave a Comment


This Blog



No tags have been created or used yet.


Privacy Statement