Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
chih
Posting Yak Master
154 Posts |
Posted - 2007-05-02 : 22:08:47
|
| Hi everyone,I would like to insert random character. for example,insert into tmp (userid,code)select userid,'b'+char(97+25*rand())+char(97+25*rand())from listBut all radnom character is the same. I think it's becasue insert statement. Is there a way to solve it? (I don't want to use cursor).Thx |
|
|
pbguy
Constraint Violating Yak Guru
319 Posts |
Posted - 2007-05-02 : 23:42:02
|
| Search for 'random number" in this forum...u find so many topics discussed and will be helpful for u. |
 |
|
|
chih
Posting Yak Master
154 Posts |
Posted - 2007-05-03 : 00:17:59
|
| I have no problem in generating random character. but when I insert them to table, all value of code are the same |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-03 : 00:39:03
|
| Make use of F_RANDOM_INTEGER() function on the following link instead of using built-in RAND() function:[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=69499[/url]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|