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 |
pvong
Yak Posting Veteran
58 Posts |
Posted - 2013-11-21 : 15:32:34
|
I basically want to update one table from another table on a different DB on another server.T1 - Ticker, Px (Want to Update PX from T2.PX where T1.Ticker = T2.Ticker)T2 - Ticker, PXNOTE - Both PX in both tables have type FLOATHere is my update statement:UPDATE T1SET Px = T1.Px.MoxyFROM MutualFundsReflowDetails AS T1 INNER JOIN (SELECT Symbol AS Ticker, Price AS Px FROM SRV5MOXY.Moxy60.dbo.MoxyPrice AS MoxyPrice_1 WHERE (SecType = 'csus')) AS T2 ON T1.Ticker = T1.Ticker When I try to run this update, I'm getting the Cannot call methods on float error message. I've Googled this but not really finding a solution.Please help a newbie!!------------------------------Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2Be kind to the newbies because you were once there. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2013-11-21 : 15:47:11
|
Have you tried running it in Management Studio instead? I think the issue is with Visual Studio.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
pvong
Yak Posting Veteran
58 Posts |
Posted - 2013-11-21 : 16:18:08
|
I have and it's still the same error message as you can see below.------------------------------Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2Be kind to the newbies because you were once there. |
|
|
pvong
Yak Posting Veteran
58 Posts |
Posted - 2013-11-21 : 16:32:58
|
Maybe I'm just writing my whole Update statement wrong but I'm not sure where it's wrong.------------------------------Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2Be kind to the newbies because you were once there. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2013-11-21 : 17:41:14
|
I think you have some typos:UPDATE T1SET Px = T2.PxFROM MutualFundsReflowDetails AS T1 INNER JOIN (SELECT Symbol AS Ticker, Price AS Px FROM SRV5MOXY.Moxy60.dbo.MoxyPrice AS MoxyPrice_1 WHERE (SecType = 'csus')) AS T2 ON T1.Ticker = T2.Ticker Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
pvong
Yak Posting Veteran
58 Posts |
Posted - 2013-11-21 : 19:32:26
|
Thanks so much!!! This worked perfectly!!!------------------------------Using VS2010 / Learning in VB.Net / Win2008 R2 / SQL 2008 R2Be kind to the newbies because you were once there. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2013-11-22 : 20:39:03
|
Glad it worked, wasn't sure. You're welcome!Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|