Monday, March 26, 2012

Making random names!

Hi
I have no idea but want to learn it how to make random names with sql server...
I have a table, called table1, for colums Firstname and Last name
I want it to make random names, so much it is possible it can get, in table2 where the colums is named Names
PLEASE HELP :)

knuff--

Regardign this...

knuff wrote:

...I have no idea but want to learn it how to make random names with sql server...

...I say, I am just guessing (and yet I think this is quite possible)...

...I expect that one could use these TSQL functions...

RAND ( [ seed ] )
Returns a random float value from 0 through 1.

ROUND ( numeric_expression , length [ , function ] )
Returns a numeric expression, rounded to the specified length or precision.

CHAR ( int )
A string function that converts an int ASCII code to a character.

...and some string contatenation to get the job done.

That said, I will add that doing something like this is MUCH better suited to middle-tier logic rather than the database, IMHO.

HTH.

Thank you.

--Mark Kamoski

|||Ok... Sounds logical to me what you wrote there i can try out of that

No comments:

Post a Comment