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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-09-11 : 14:07:20
|
| Chris Pennington writes "Hi there!I have a dB with 2 related tables, PROJECTS and PROJECTSPHONE with the column PROJECTID in common.I am trying to update a field calls ROUTINGID within PROJECTSPHONE, based on a column name witin PROJECTS called NAME.I can select the data using:select projects.name, projectsphone.routingid from projects, projectsphone where projects.projectid = projectsphone.projectidand projects.name like '%ooh%';I have tried the following update statement:update projectsphone set projectsphone.routingid = '111' where projectsphone.projectid = projects.projectidand projects.name like '%ooh%';However this gives me the following error message:Server: Msg 107, Level 16, State 3, Line 1The column prefix 'projects' does not match with a table name or alias name used in the query.Is this kind of update possible?I am using SQL server 7.0.Thanks in advance.RegardsChris Pennington" |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-09-11 : 14:44:27
|
update pp set pp.routingid = '111' from projects p join projectsphone ppon p.projectid = pp.projectid where p.name like '%ooh%' HTHJasper Smith |
 |
|
|
|
|
|