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 |
|
bobbles22
Starting Member
18 Posts |
Posted - 2010-04-07 : 09:04:53
|
| Is there a way to update one table based on the entry in a column in another table. Basically, I need to set the salutation of a person based on the start of the company name (as we set individuals to be in a company called 'Mr A Nother'). Any ideas how I could do this? I want to update all the salutations to the first part of the company name. Ideas? Many thanks. Bob |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2010-04-07 : 09:08:47
|
| If you can form a relation then you can make a simple update.Can you describe the tables involved and explain how you'd form a link from the person to the relevant company?Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-07 : 12:45:14
|
the query will be of the formUPDATE tSET t.Columntochange=p.ChangevaluecolFROM YourTable tJOIN LookupTable pON p.LinkCol=t..LinkCol linkcol is column by which two tables are related------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|