Randomic Record

  • Does anyone now how can i sort one record in one table of my database? Is there a function for it? Something similar to RANDOMIZE of Pascal..

    Thanks! 😀


    David Falcão
    www.darte.com.br

  • There is RAND but not a very good random number. You question is a little confusing to know what you want.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • I'll try to explain better now..

    Let's say that i have a table with questions from a test..And i want my stored procedure to sort one random question from my table.

    The question is? How can i sort this question?

    Will i have to create a stored proc to do that or there is a function that already do that for me?

    Thanks..


    David Falcão
    www.darte.com.br

  • you can play with NEWID and order it ,to get the records in random order. i had seen this article on another site. if the moderators are comfortable with the idea, i can post the link.

  • Links are ok to post here and I am curious about this propsed method.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanx Antares, i was carefull coz the site am refferign to also has forums and am a regular there.

    Anywayz, herez the link http://www.sqlteam.com/item.asp?ItemID=8747 .

    Alternatively if you are using SQL 7.0 . you can try this too

    http://www.sqlteam.com/item.asp?ItemID=217

    HTH

  • Cool, had never thought of that. Works great.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 7 posts - 1 through 6 (of 6 total)

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