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 |
|
romeck
Starting Member
16 Posts |
Posted - 2010-12-09 : 16:13:20
|
| Hi , i have two tables: 1st table: WA: id, name, code, cat2d: CA: id, code, xxxthe first one is conected with second like WA.cat=Ca.id , i want to set cat on CA.id where CA.code is in WA.name and try to do sth like that : UPDATE [WA] as wa, [CA] as ca SET wa.cat=ca.id WHERE wa.nazwa like '%'+ca.code+'%'GObut it gives me : Msg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'as'.How can i do it ? |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-12-09 : 16:19:37
|
| [code]UPDATE waSET cat = ca.idFROM [WA] as waJOIN [CA] as caOn wa.nazwa like '%' + ca.code + '%'GO[/code] |
 |
|
|
|
|
|