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
 General SQL Server Forums
 New to SQL Server Programming
 multi-part identifier error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 03/13/2013 :  10:59:54  Show Profile  Reply with Quote
im using this code and getting the following any ideas why
UPDATE dbo.TempSimulation 
SET  generic.HistoricalPrice.ShareCurrency= dbo.TempSimulation.ShareCurrency

FROM dbo.TempSimulation 
INNER JOIN generic.HistoricalPrice ON 
dbo.TempSimulation.ThirdSimulation= generic.HistoricalPrice.ISIN


Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "generic.HistoricalPrice.ShareCurrency" could not be bound.

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 03/13/2013 :  11:06:33  Show Profile  Reply with Quote

UPDATE t
SET  t.ShareCurrency= g.ShareCurrency
FROM dbo.TempSimulation t 
INNER JOIN generic.HistoricalPrice g
ON t.ThirdSimulation= g.ISIN


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 03/13/2013 :  11:07:44  Show Profile  Reply with Quote
ok thanks will try that
Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 03/13/2013 :  11:07:44  Show Profile  Reply with Quote
ok thanks will try that
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 03/13/2013 :  11:08:18  Show Profile  Reply with Quote
if that still doesn't work:
"could not be bound" error often means that the table definition was changed (like a dropped/renamed column). If either of these objects are views and the underlying DDL changed then then you need to recompile the view and don't use "select *" in the view but rather an explicit column list.

Be One with the Optimizer
TG
Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 03/13/2013 :  11:10:41  Show Profile  Reply with Quote
that doesnt work i have to have it like this
SET g.ShareCurrency = t.ShareCurrency
as i want to update the t.sharecurrency values with the g.sharecurrency values
so when i change it back get same error

Edited by - rjhe22 on 03/13/2013 11:12:25
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 03/13/2013 :  11:14:07  Show Profile  Reply with Quote
is the column name correct? ie ShareCurrency

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 03/13/2013 :  11:15:38  Show Profile  Reply with Quote
ya the column name is def correct
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 03/13/2013 :  11:20:45  Show Profile  Reply with Quote
i'm asking on HistoricalPrice table

post the DDL for the tables please

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 03/13/2013 :  11:25:16  Show Profile  Reply with Quote
ya its def right i dragged and drop it over to my query to make sure
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 03/13/2013 :  11:29:51  Show Profile  Reply with Quote
dragged and dropped from where?

can you post your exact query now?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 03/13/2013 :  11:31:20  Show Profile  Reply with Quote
update ts
set hp.ShareCurrency = ts.ShareCurrency
from generic.HistoricalPrice hp
INNER JOIN dbo.TempSimulation ts
ON ts.ThirdSimulation= hp.ISIn

column names are def right
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 03/13/2013 :  11:33:10  Show Profile  Reply with Quote
why cant you use it as suggested? you still have it other way around!


update ts
set ts.ShareCurrency = hp.ShareCurrency
from generic.HistoricalPrice hp
INNER JOIN dbo.TempSimulation ts
ON ts.ThirdSimulation= hp.ISIn 


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

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.08 seconds. Powered By: Snitz Forums 2000