SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


TSQL


TSQL

Author
Message
mverma4you
mverma4you
Right there with Babe
Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)

Group: General Forum Members
Points: 761 Visits: 226
Comments posted to this topic are about the item TSQL
mister.magoo
mister.magoo
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26352 Visits: 7939
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
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • David-420660
    David-420660
    SSC Veteran
    SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)

    Group: General Forum Members
    Points: 286 Visits: 43
    I agree. The answer is wrong according to the given explanation.
    Douglas Duncan
    Douglas Duncan
    SSC Eights!
    SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)SSC Eights! (885 reputation)

    Group: General Forum Members
    Points: 885 Visits: 325
    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
    ChiragNS
    ChiragNS
    SSChampion
    SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

    Group: General Forum Members
    Points: 14577 Visits: 1865
    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"
    Balachandra
    Balachandra
    SSCrazy
    SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

    Group: General Forum Members
    Points: 2497 Visits: 225
    Hi

    Can we get any poinsts for such questions ?
    hayzer
    hayzer
    SSC-Addicted
    SSC-Addicted (485 reputation)SSC-Addicted (485 reputation)SSC-Addicted (485 reputation)SSC-Addicted (485 reputation)SSC-Addicted (485 reputation)SSC-Addicted (485 reputation)SSC-Addicted (485 reputation)SSC-Addicted (485 reputation)

    Group: General Forum Members
    Points: 485 Visits: 88
    that was confusing!

    like a lady who changes her mind very every now and then.. :-D

    but anyway, i think they should give the points on this one...
    mithun.gite
    mithun.gite
    Ten Centuries
    Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

    Group: General Forum Members
    Points: 1267 Visits: 364
    I think there is a approval process before this question comes in "QOD"....
    mverma4you
    mverma4you
    Right there with Babe
    Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)

    Group: General Forum Members
    Points: 761 Visits: 226
    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.
    mithun.gite
    mithun.gite
    Ten Centuries
    Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

    Group: General Forum Members
    Points: 1267 Visits: 364
    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 ???
    Go


    Permissions

    You can't post new topics.
    You can't post topic replies.
    You can't post new polls.
    You can't post replies to polls.
    You can't edit your own topics.
    You can't delete your own topics.
    You can't edit other topics.
    You can't delete other topics.
    You can't edit your own posts.
    You can't edit other posts.
    You can't delete your own posts.
    You can't delete other posts.
    You can't post events.
    You can't edit your own events.
    You can't edit other events.
    You can't delete your own events.
    You can't delete other events.
    You can't send private messages.
    You can't send emails.
    You can read topics.
    You can't vote in polls.
    You can't upload attachments.
    You can download attachments.
    You can't post HTML code.
    You can't edit HTML code.
    You can't post IFCode.
    You can't post JavaScript.
    You can post emoticons.
    You can't post or upload images.

    Select a forum








































































































































































    SQLServerCentral


    Search