3

In a recent interview I was asked to name a built-in function(s) that cannot be called from inside a stored procedure or a user defined function (both scalar and table-value). I didn't know the answer to the question and gave the generic "I don't know but I'd love to find out."

It turns out after doing a bit of research that I'm no closer to the answer than when I was asked in the interview and now I'm wondering if it was a trick question.

Is this a trick question or is there a real answer?

Thanks.

1
  • 11
    Another specimen of worthless interview questions. Tells nothing of your knowledge and skills. Commented Sep 9, 2010 at 15:48

3 Answers 3

5

My answer would have been the functions that are specific to triggers.

Sign up to request clarification or add additional context in comments.

Comments

0

I know that Scalar functions are required to be deterministic (e.g. given an input the same results always come back).This means you may not call any non-deterministic functions like NewID or GetDate.

I'm pretty sure that table valued functions don't have this problem.

I'm also unaware of a Built in function that can't be called from a stored proc. What would be the point of the function be?

Obviously this is aside from Joe Stefanelli's answer.

2 Comments

I don't follow your point. For example, I use GETDATE() in stored procedures all the time.
NewID and GetDate both can be called in a stored procedure.
0

Agree with Conrad re: deterministric functions. I would have explained my understanding of this and confirmed with the interviewer that the question was indeed asking about both functions and sprocs.

If their truly is an answer and I had to guess...I'd have likely said "any functions that alter server configuration".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.