| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-04-11 : 08:52:19
|
| John writes "I am having trouble with the insert into statement in one of my queries everytime I run the query I get back this error Server: Msg 207, Level 16, State 1, Line 1Invalid column name 'cancelled_partsField9'.Here is a sample of the syntax insert into drf1 (Docuno, WON, Part_No, Part#, REQ, REC, DI, DIC, Closed, Status, Task, WC, [cancelled_partsField9], [drsf_finalfield9], BSL, ADDR, Stic, FC, SSID, RDD)SELECT Drf.Docuno, Drf.WON, Drf.Part_No, Drf.Part#, Drf.REQ, Drf.REC, Drf.DI, Drf.DIC, Drf.CLOSED,'RC', Drf.TASK, Drf.WC, cancelled_parts.[field9], drsf_final.[field9], Drf.BSL, Drf.ADDR, Drf.STIC, Drf.FC, Drf.SSID, Drf.RDD FROM ((Drf LEFT JOIN cancelled_parts ON Drf.Docuno = cancelled_parts.Field1) LEFT JOIN received_parts ON Drf.Docuno = received_parts.Field1) LEFT JOIN drsf_final ON Drf.Docuno = drsf_final.Field1WHERE (((Drf.DIC)<>'D6Z'))ORDER BY Drf.Docuno;I have tried simply running the Select statement and leaving out the Insert in the Query analyzer and that works but the Insert does not??? I am using SQL Server 2000 on Windows 2000" |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-04-11 : 08:56:35
|
| Check to see whether the columns match your select , and if you a column name like the one listed in the error.i would suggest you to post the table schema for drf1 table.-------------------------------------------------------------- |
 |
|
|
rihardh
Constraint Violating Yak Guru
307 Posts |
Posted - 2002-04-11 : 10:06:44
|
quote: John writes "I am having trouble with the insert into statement in one of my queries everytime I run the query I get back this error Server: Msg 207, Level 16, State 1, Line 1Invalid column name 'cancelled_partsField9'.Here is a sample of the syntax insert into drf1 (Docuno, WON, Part_No, Part#, REQ, REC, DI, DIC, Closed, Status, Task, WC, [cancelled_partsField9], [drsf_finalfield9], BSL, ADDR, Stic, FC, SSID, RDD)SELECT Drf.Docuno, Drf.WON, Drf.Part_No, Drf.Part#, Drf.REQ, Drf.REC, Drf.DI, Drf.DIC, Drf.CLOSED,'RC', Drf.TASK, Drf.WC, cancelled_parts.[field9], drsf_final.[field9], Drf.BSL, Drf.ADDR, Drf.STIC, Drf.FC, Drf.SSID, Drf.RDD FROM ((Drf LEFT JOIN cancelled_parts ON Drf.Docuno = cancelled_parts.Field1) LEFT JOIN received_parts ON Drf.Docuno = received_parts.Field1) LEFT JOIN drsf_final ON Drf.Docuno = drsf_final.Field1WHERE (((Drf.DIC)<>'D6Z'))ORDER BY Drf.Docuno;I have tried simply running the Select statement and leaving out the Insert in the Query analyzer and that works but the Insert does not??? I am using SQL Server 2000 on Windows 2000"
|
 |
|
|
rihardh
Constraint Violating Yak Guru
307 Posts |
Posted - 2002-04-11 : 10:25:09
|
| Sorry for the previous reply (was a bit too fast).I agree with Nazim. The only problem seems to be in the "drf1" table.By the way, whats the deal with field names in parentheses? |
 |
|
|
|
|
|