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 |
|
JeffS23
Posting Yak Master
212 Posts |
Posted - 2008-01-06 : 19:08:41
|
| I have two tables. one Named 'attachments' which has 3 fields that are relevant.id - autonumber (unique)userid - (id from 'users' table)visible - bitThe other table is 'users', which has 3 relevant fields userid - autonumber (unique) - key for the attachmets tabletype - (nvarchar)I need to update Attachments table and set visible = 0 when the userid joins the users table and the 'type' field of the 'users' table = 'corpuser'I hope I explained myself. |
|
|
nathans
Aged Yak Warrior
938 Posts |
Posted - 2008-01-06 : 19:23:28
|
you can see such example in BOL.update aset visible = 0from Attachments ainnerjoin Users u on a.UserID = u.UserIDwhere u.Type = 'corpuser' Nathan Skerl |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-01-06 : 19:24:54
|
| update attachments set a.visible = 0 from attachments a join users u on a.userid = u.userid where u.type = 'corpuser'step behind. |
 |
|
|
|
|
|