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 - 2005-06-13 : 08:32:25
|
| Nkagi writes "Dear All,This might sound like a stupid question but I will ask it anyway, by the way I'm still a beginner so please bear with me.I am trying to update a table called erven with the statement below, but everytime I excecute it I get an error.(Server: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near '('.)update erven set (ErfNr, suburb, Owner, street, stno) = (select Col003 as ErfNo, suburb, Col002 as Owner, col004 as street, stno as strno from import where accno = erfaccountno);I trie changing it to the following but it still produces errors (erver: Msg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'select'.Server: Msg 156, Level 15, State 1, Line 2Incorrect syntax near the keyword 'select'.Server: Msg 156, Level 15, State 1, Line 3Incorrect syntax near the keyword 'select'.Server: Msg 156, Level 15, State 1, Line 4Incorrect syntax near the keyword 'select'.Server: Msg 156, Level 15, State 1, Line 5Incorrect syntax near the keyword 'select'.):update erven set ErfNr = select Col003 as ErfNo from import,erven where accno = erfaccountnoupdate erven set suburb = select suburb from import where accno = erfaccountnoupdate erven set Owner = select Col002 as Owner from import where accno = erfaccountnoupdate erven set street = select col004 as street from import where accno = erfaccountnoupdate erven set stno = select stno as strno from import where accno = erfaccountnoplease help me." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|