I agree. The answer is wrong according to the given explanation.
The correct answer is no, and I would imagine that the people in power will correct the issue soon. In addition to the explanation given in the answer, the following which is taken directly from the MSDN page used as a reference states you cannot use RAND (in addition to several other built-in functions) in UDFs:
Built-in functions that can return different data on each call are not allowed in user-defined functions. The built-in functions not allowed in user-defined functions are:
@@CONNECTIONS
@@CPU_BUSY
@@IDLE
@@IO_BUSY
@@MAX_CONNECTIONS
@@PACK_RECEIVED
@@PACK_SENT
@@PACKET_ERRORS
@@TIMETICKS
@@TOTAL_ERRORS
@@TOTAL_READ
@@TOTAL_WRITE
GETDATE
GetUTCDate
NEWID
RAND
TEXTPTR
Douglas Duncan (4/11/2009)
The correct answer is no, and I would imagine that the people in power will correct the issue soon. In addition to the explanation given in the answer, the following which is taken directly from the MSDN page used as a reference states you cannot use RAND (in addition to several other built-in functions) in UDFs:Built-in functions that can return different data on each call are not allowed in user-defined functions. The built-in functions not allowed in user-defined functions are:
@@CONNECTIONS
@@CPU_BUSY
@@IDLE
@@IO_BUSY
@@MAX_CONNECTIONS
@@PACK_RECEIVED
@@PACK_SENT
@@PACKET_ERRORS
@@TIMETICKS
@@TOTAL_ERRORS
@@TOTAL_READ
@@TOTAL_WRITE
GETDATE
GetUTCDate
NEWID
RAND
TEXTPTR
i certainly hope so.
"Keep Trying"
Hi
Can we get any poinsts for such questions ?
Balachandra Srinevasalu
that was confusing!
like a lady who changes her mind very every now and then..
but anyway, i think they should give the points on this one...
I think there is a approval process before this question comes in "QOD"....
don't cry too much this is not your Board exam. Regarding the point moderator will check for the point.:-D. I can't modified the answer of this question and motive of QOD it just to update yourself on various SQL topic. So even the question’s answer was as wrong but you learn something about the RAND() function.
mverma4you (4/13/2009)
don't cry too much this is not your Board exam. Regarding the point moderator will check for the point.:-D. I can't modified the answer of this question and motive of QOD it just to update yourself on various SQL topic. So even the question’s answer was as wrong but you learn something about the RAND() function.
What kind of explanation is that ???
Yes I do agree. But Answer is "NO". Why they have given "Yes" and explanation 'No'. Its totally contradiction.
The answer is No, as the explanation describes, yet if you answer no it is incorrect?
How can this be?
Is there some secret I am missing here?
Seems to have been an oversight. Answer is clearly No...
The question is sort-of tricky. the real answer is "Indirectly" there are tricks to use rand() when you normally shouldn't be able to...
No! Yes! .... Maybe? should be a third option then... As what a former poster said, it sounds like SQL Server has a female intuition inside
Ronald HensbergenHelp us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/-------------------------------------------------------------------------2+2=5 for significant large values of 2
Viewing 15 posts - 1 through 15 (of 31 total)
You must be logged in to reply to this topic. Login to reply