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';
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';