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 |
osupratt
Posting Yak Master
238 Posts |
Posted - 2010-08-16 : 14:56:09
|
Would anyone know what is wrong with this:INSERT INTO TestFTHeader (Shift)SELECT Misc_Text_Field_5FROM Field_Ticket_Detail AS dtlWHERE TestFTHeader.FTNumber = dtl.Field_Ticket_Number ? Sorry, probably something very easy. I'm getting this error:The multi-part identifier "TestFTHeader.FTNumber" could not be bound.When I take out the identifier and have the syntax look like this:INSERT INTO TestFTHeader (Shift)SELECT Misc_Text_Field_5FROM Field_Ticket_Detail AS dtlWHERE FTNumber = dtl.Field_Ticket_Number I get this error:Invalid column name 'FTNumber'.I'm kind of lost on this. Thanks for anyone's help. |
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-08-16 : 15:23:34
|
Can you explain in words what you are trying to accomplish. From what I can see, I think what you need is an UPDATE and not an INSERT. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
osupratt
Posting Yak Master
238 Posts |
Posted - 2010-08-16 : 15:52:28
|
Yes..you all are right. I should be doing an UPDATE. How do I do this from one table to another?UPDATE TestFTHeader SET TestFTHeader.Shift = Field_Ticket_Detail.Misc_Text_Field_5 WHERETestFTHeader.FTNumber= Field_Ticket_Detail.Field_Ticket_Number |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
osupratt
Posting Yak Master
238 Posts |
Posted - 2010-08-16 : 17:09:25
|
Thanks very much. I saw this, but could not figure it out. I appreciate your help. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|