怎样只更新指定的表,请帮帮忙啊 ( 积分: 100 )

  • 主题发起人 主题发起人 c3411080
  • 开始时间 开始时间
C

c3411080

Unregistered / Unconfirmed
GUEST, unregistred user!
胜天的软件以下的sql语句在Access可以用ADOSet的pos只保存表Ware的数据,但在sql-Server保存却出错,显示无法更新 ,sql-server数据库中怎样只保存表ware的数据呢?
sSql := ' SELECT W.ID, W.TreeParent, W.UserCode, W.Name, W.ShortName, W.PinYin, W.Model, W.Spec,' +
' W.Area, W.Type, W.Unit, W.Unit2, W.Scale, W.Sort, W.BarCode, W.Pos_Price, W.Pos_Purch,' +
' W.ConstPrice, W.Price1, W.Price2, W.Price3, W.Price4, W.Up_Limit, W.Down_Limit, W.Memo, W.Use, W.Mode,' +
' Sum(WS.Number) AS SumNumber, Sum(WS.Total) AS SumTotal' +
' FROM Ware AS W LEFT JOIN WareStock AS WS ON W.ID = WS.WareID ' +
' GROUP BY W.ID, W.TreeParent, W.UserCode, W.Name, W.ShortName, W.PinYin, W.Model, W.Spec,' +
' W.Area, W.Type, W.Unit, W.Unit2, W.Scale, W.Sort, W.BarCode, W.Pos_Price, W.Pos_Purch,' +
' W.ConstPrice, W.Price1, W.Price2, W.Price3, W.Price4, W.Up_Limit, W.Down_Limit, W.Memo, W.Use, W.Mode';
 
胜天的软件以下的sql语句在Access可以用ADOSet的pos只保存表Ware的数据,但在sql-Server保存却出错,显示无法更新 ,sql-server数据库中怎样只保存表ware的数据呢?
sSql := ' SELECT W.ID, W.TreeParent, W.UserCode, W.Name, W.ShortName, W.PinYin, W.Model, W.Spec,' +
' W.Area, W.Type, W.Unit, W.Unit2, W.Scale, W.Sort, W.BarCode, W.Pos_Price, W.Pos_Purch,' +
' W.ConstPrice, W.Price1, W.Price2, W.Price3, W.Price4, W.Up_Limit, W.Down_Limit, W.Memo, W.Use, W.Mode,' +
' Sum(WS.Number) AS SumNumber, Sum(WS.Total) AS SumTotal' +
' FROM Ware AS W LEFT JOIN WareStock AS WS ON W.ID = WS.WareID ' +
' GROUP BY W.ID, W.TreeParent, W.UserCode, W.Name, W.ShortName, W.PinYin, W.Model, W.Spec,' +
' W.Area, W.Type, W.Unit, W.Unit2, W.Scale, W.Sort, W.BarCode, W.Pos_Price, W.Pos_Purch,' +
' W.ConstPrice, W.Price1, W.Price2, W.Price3, W.Price4, W.Up_Limit, W.Down_Limit, W.Memo, W.Use, W.Mode';
 
不懂,上面只是一个查询语句赋值给一个string变量啊?你到底是要什么意思呢?
 
同感,楼上的完全正确.
 
你把Access表的数据导入SQL SERVER里再查询还有错吗?
 
把出错的地方贴出来看看
 
更新指定的表肯定不是這一句,樓主貼錯了吧?
 
贴了查询语句,估计楼主搞错了
 
没错,就是这个sql语句,在Access数据保存是没有问题,但在sql-Server保存却出错.
如果我有二个表
a表的字段有
id custno, custname,qty
b表的字段有
id a_id,Rqty
现在我要在a表实行新增或修改,但要显示一个计算字段(qty-Rqty) 怎样用sql语句实现呢?
 
他们两的多表更新机制是不同的,你是这个意思吗?
 
后退
顶部