Hi,
This could be done in several ways. Here's a script that I came up with. It uses the Products table of the AdventureWorks database. It randomly selects a record and displays the [Name] and [ProductNumber] columns:
SELECT
[Name],
[ProductNumber]
FROM
(
SELECT
ROW_NUMBER() OVER (ORDER BY [ProductID]) AS Counter,
[Name],
[ProductNumber]
FROM
Production.Product
) Prod
WHERE
Prod.Counter = ROUND(RAND() * (SELECT COUNT(*) FROM Production.Product),0)
Any other ideas?
Cheers
Gogula G. Aryalingam (MVP - SQL Server)