Author |
Topic |
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-13 : 10:59:54
|
im using this code and getting the following any ideas whyUPDATE dbo.TempSimulation SET generic.HistoricalPrice.ShareCurrency= dbo.TempSimulation.ShareCurrencyFROM dbo.TempSimulation INNER JOIN generic.HistoricalPrice ON dbo.TempSimulation.ThirdSimulation= generic.HistoricalPrice.ISIN Msg 4104, Level 16, State 1, Line 1The multi-part identifier "generic.HistoricalPrice.ShareCurrency" could not be bound. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 11:06:33
|
[code]UPDATE tSET t.ShareCurrency= g.ShareCurrencyFROM dbo.TempSimulation t INNER JOIN generic.HistoricalPrice gON t.ThirdSimulation= g.ISIN[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-13 : 11:07:44
|
ok thanks will try that |
|
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-13 : 11:07:44
|
ok thanks will try that |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-03-13 : 11:08:18
|
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 OptimizerTG |
|
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-13 : 11:10:41
|
that doesnt work i have to have it like thisSET g.ShareCurrency = t.ShareCurrencyas i want to update the t.sharecurrency values with the g.sharecurrency valuesso when i change it back get same error |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 11:14:07
|
is the column name correct? ie ShareCurrency------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-13 : 11:15:38
|
ya the column name is def correct |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 11:20:45
|
i'm asking on HistoricalPrice tablepost the DDL for the tables please------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-13 : 11:25:16
|
ya its def right i dragged and drop it over to my query to make sure |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 11:29:51
|
dragged and dropped from where?can you post your exact query now?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rjhe22
Constraint Violating Yak Guru
283 Posts |
Posted - 2013-03-13 : 11:31:20
|
update tsset hp.ShareCurrency = ts.ShareCurrencyfrom generic.HistoricalPrice hpINNER JOIN dbo.TempSimulation tsON ts.ThirdSimulation= hp.ISIn column names are def right |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 11:33:10
|
why cant you use it as suggested? you still have it other way around!update tsset ts.ShareCurrency = hp.ShareCurrencyfrom generic.HistoricalPrice hpINNER JOIN dbo.TempSimulation tsON ts.ThirdSimulation= hp.ISIn ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|