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 |
|
wongz
Starting Member
6 Posts |
Posted - 2003-10-27 : 20:46:32
|
| HiI have a tblUser where i want to update the users password.I manage to write a code that randomly generate user password but i would like to update it to all the 1000 records. How can i do that, please help. |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-10-27 : 21:09:50
|
| As you can't use a function use the unique field on the table (user_id?)declare @pwd varchar(50)declare @user_id intselect @user_id intwhile @user_id < (select max(user_id) from tblUser)beginselect @user_id = min(user_id) from tblUser where user_id > @user_idexec s_GetPwd @pwd outupdate tblUser set pwd = @pwd where user_id = @user_idend==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
wongz
Starting Member
6 Posts |
Posted - 2003-10-27 : 21:25:57
|
| thank you very much.....it works.. ^_^ |
 |
|
|
|
|
|