SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Help with an UPDATE
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pharoah35
Yak Posting Veteran

81 Posts

Posted - 11/13/2007 :  08:24:04  Show Profile  Reply with Quote
Good morning

I was hoping someone could lend some assistance concerning this problem. I am trying to update a column in a table. However when I attempt to run it, I get the following error message:

"Msg 107, Level 16, State 3, Line 1
The column prefix 'dbo.TransNet Corporation_Test$Sales Invoice Header' does not match with a table name or alias name used in the query.
Msg 107, Level 16, State 3, Line 1
The column prefix 'dbo.TransNet Corporation_Test$Sales Invoice Header' does not match with a table name or alias name used in the query.
Msg 107, Level 16, State 3, Line 1
The column prefix 'dbo.TransNet Corporation_Test$Sales Invoice Header' does not match with a table name or alias name used in the query."

Here is my transact:

update dbo.[TransNet Corporation_Test$Sales Commission]
set [Cust PO No] = dbo.[TransNet Corporation_Test$Sales Invoice Header].[Customer PO_ No_]
where (dbo.[TransNet Corporation_Test$Sales Invoice Header].[No_] = [Inv No])
AND(dbo.[TransNet Corporation_Test$Sales Invoice Header].[Posting Date] = [Posting Date])

Thanks
Pharoah35

harsh_athalye
Flowing Fount of Yak Knowledge

India
5509 Posts

Posted - 11/13/2007 :  08:30:48  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
update t1
set [Cust PO No] = t2.[Customer PO_ No_]
From dbo.[TransNet Corporation_Test$Sales Commission] t1
join dbo.[TransNet Corporation_Test$Sales Invoice Header] t2
on t2.[No_] = t1.[Inv No]
AND t2.[Posting Date] = t1.[Posting Date]


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"

Edited by - harsh_athalye on 11/13/2007 08:31:52
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22744 Posts

Posted - 11/13/2007 :  08:33:59  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Try

update T
set [Cust PO No] = S.[Customer PO_ No_]
from dbo.[TransNet Corporation_Test$Sales Commission] T
inner join dbo.[TransNet Corporation_Test$Sales Invoice Header] S
on S.[No_] = [Inv No])
AND S.[Posting Date] = [Posting Date]


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22744 Posts

Posted - 11/13/2007 :  08:34:30  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

pharoah35
Yak Posting Veteran

81 Posts

Posted - 11/13/2007 :  08:42:38  Show Profile  Reply with Quote
Hi harsh_athalye

I just wanted to thank you so much for your assistance. This worked wonderfully

Thanks again
Pharoah35
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000