TSQL

  • Comments posted to this topic are about the item TSQL

  • The answer is wrong - you click No - and get told you are wrong.then the explanation goes on to agree that you cannot use RAND...@?

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]

  • 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 ?

  • 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 32 total)

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