无法绑定由多个部分组成的标识列
大家好,請教個問題,我用的vs2005和sql2005,在查詢分析器中,我有這樣的語句:SELECT G_Location.BranchCode, G_Location.LocationCode, G_Location.LocationName, G_Location.LocationNickName, G_Location.LocalSectionCode, G_Location.CompanyCode, G_Location.GyoumuInfo, MR_HosenLocation.MenuPtnId, MR_HosenLocation.ShinkansenKbn, MR_HosenLocation.ZairaisenKbn, MR_HosenLocation.DenshiShoninHyojiFlg, MR_HosenLocation.DefaultBranchCode, MR_HosenLocation.DefaultLocationCode, MR_HosenLocation.PlantCode, MR_HosenLocation.HokanBasho, MR_HosenLocation.TsutatsuKeihatsuKbn, MR_HosenLocation.YosanSekininsha, MR_HosenLocation.TammuLevelPtnCode, MR_HosenLocation.MaintenanceKbn, MR_HosenLocation.HyojiJuni FROM DB_Mst.SCH_Mst.G_Location INNER JOIN DB_Mst.SCH_Mst.G_SystemUseLocation ON G_Location.BranchCode=G_SystemUseLocation.BranchCode AND G_Location.LocationCode=G_SystemUseLocation.LocationCode INNER JOIN DB_Mst.SCH_Mst.MR_HosenLocation ON G_Location.BranchCode=MR_HosenLocation.BranchCode AND G_Location.LocationCode=MR_HosenLocation.LocationCode WHERE G_SystemUseLocation.SystemCode = 'SR' 這個是可以正常執行的,我把它寫在了代碼里,一直以來也沒有問題,程序可以正常工作,可是就在昨天,程序運行到這里的時候,突然就出現了{"The multi-part identifier \"G_Location.BranchCode\" could not be bound.\r\nThe multi-part identifier \"G_SystemUseLocation.BranchCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.LocationCode\" could not be bound.\r\nThe multi-part identifier \"G_SystemUseLocation.LocationCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.BranchCode\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.BranchCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.LocationCode\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.LocationCode\" could not be bound.\r\nThe multi-part identifier \"G_SystemUseLocation.SystemCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.BranchCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.LocationCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.LocationName\" could not be bound.\r\nThe multi-part identifier \"G_Location.LocationNickName\" could not be bound.\r\nThe multi-part identifier \"G_Location.LocalSectionCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.CompanyCode\" could not be bound.\r\nThe multi-part identifier \"G_Location.GyoumuInfo\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.MenuPtnId\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.ShinkansenKbn\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.ZairaisenKbn\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.DenshiShoninHyojiFlg\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.DefaultBranchCode\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.DefaultLocationCode\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.PlantCode\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.HokanBasho\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.TsutatsuKeihatsuKbn\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.YosanSekininsha\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.TammuLevelPtnCode\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.MaintenanceKbn\" could not be bound.\r\nThe multi-part identifier \"MR_HosenLocation.HyojiJuni\" could not be bound."} 的錯誤,我調查了之后,將select的字段和where中的條件都加上了DB名和Schema名的前綴"DB_Mst.SCH_Mst.",再次執行到這里的時候就可以正常通過,我很疑惑,為什么在查詢分析器中可以正常執行呢,還有為什么以前沒有出現這樣的錯誤,就是現在,在其它的機器上,程序執行到這里也是一樣沒有異常的,我以為是DB服務器的配置出了問題,可是在連接不同的DB服務器是也還是這樣,只是這一臺測試機不通過,其它機器沒問題;因為這部分程序已經提交了,客戶那里沒有出現這樣的問題,我不便再去修改sql了,請問,這些問題是sql語句本身的錯誤嗎,還有沒有其它的原因,急盼賜知,不勝感激!
...全文
相关推荐
Vue循环中多个input绑定指定v-model实例
当涉及到在循环中使用`v-model`时,通常是为了创建多个类似的表单元素,如在列表或表格中。以下将详细介绍如何在Vue循环中为多个`input`元素绑定不同的`v-model`实例。1.
多个绑定好的3DMAX人物角色精模
带骨骼模型"是3D角色建模的重要组成部分,它指的是通过骨骼系统与模型的几何体进行关联,使得模型能够进行各种动作。骨骼绑定(Skinning)技术允许3D角色随着骨骼的移动而变形,实现动态效果。
js事件on动态绑定数据,绑定多个事件的方法
JavaScript中的事件绑定是Web开发中不可或缺的一部分,它允许我们在用户与网页交互时执行特定的代码。
为wordpress绑定多个域名的方法分享
"这篇文章主要介绍了如何为WordPress绑定多个域名,解决WordPress默认的单一主域名问题。WordPress在默认情况下会根据设定的home_url自动跳转,导致其他绑定的域名无法正常工
多个单选按钮的WPF MVVM绑定
MVVM模式由三个主要部分组成:Model(模型),View(视图)和ViewModel(视图模型)。


疑难问题
