in reply to SQL solution or Perl solution?

RAND function, from the Transact-SQL Reference (SQL Server 2000).

HTH,

planetscape