$ 0 0 Hi, I have this function called fn_GetTimedKey() when I run it in my SQL2005 environment it works fine. When I run it in my SQL2008R2 environment I get the error: Only functions and some extended stored procedures can be executed from within a function. The SQL2008R2 server is new. What can I look for? Here's the code for the function:BEGIN DECLARE @v_Key CHAR(12) EXEC master..xp_usg_gettimedkey_VAL @v_Key OUTPUT RETURN @v_Key ENDqeqw