all groups > sql server programming > march 2004 >
You're in the

sql server programming

group:

RAND() in a TF


Re: RAND() in a TF Joe Celko
3/6/2004 1:06:21 PM
sql server programming:
Why build when you can buy? These people sell test data generator
tools:

http://www.upscene.com/

--CELKO--
===========================
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Developersdex http://www.developersdex.com ***
RAND() in a TF Stephen J Bement
3/6/2004 3:25:21 PM
I am trying to create database populator that gathers a random FirstName and
a random LastName. I need the output from the first stage to return a Table
variable( so I can JOIN to other tables). I am being thwarted by "Invalid
use of 'RAND' within a function."

Does anyone know of a way to accomplish this?

--
Semper Fi,
Red

Please post to newsgroup only

Re: RAND() in a TF David Portas
3/6/2004 8:54:26 PM
Maybe this example will help:

SELECT TOP 10 firstname, lastname
FROM
(SELECT firstname
FROM Northwind..employees) AS F
CROSS JOIN
(SELECT lastname
FROM Northwind..employees) AS L
ORDER BY NEWID()

--
David Portas
SQL Server MVP
--

AddThis Social Bookmark Button