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 |
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2004-05-18 : 00:55:00
|
| Whats the best way to do something like thisI want to insert mail into the mail table for all users with a stateID matching '3'. I can join the two tables on userID. Im looking to insert about 5000 rowsTblMail(messageID,userID,mailmessage)tblUsers(UserID,stateID)Any help is greatly appreciatedThanks alot,mike123 |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-05-18 : 01:05:54
|
| Assuming you want to: - add one TblMail item for each tblUsers record - all mail items are the same - the TblMail.messageID is the primary key (with Identity)INSERT INTO TblMail(userID, mailmessage)(SELECT UserID, 'This is the mail message to insert'FROM tblUsers)Is this what you're looking for?Tim |
 |
|
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2004-05-18 : 01:49:15
|
| perfect thanks! |
 |
|
|
|
|
|