Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random quote for the day..
Message
De
12/04/2009 13:03:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01394387
Message ID:
01394416
Vues:
80
>>>What's a better way to do a random "quote for the day"?
>>
>>What is your back-end?
>>
>>In SQL Server to generate a random record you will use
>>
>>select top 1 * from myTable order by NewID()
>>
>>In VFP I would agree with Sergey about generating random record using rand() function.
>
>Does that really work in SQL Server? I had not thought of using NewID in that way.

Yes it works, because NewID generates a GUID which is a 128 bits random integer.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform