在sqlserver中运行没问题的存储过程,在C#程序内访问,却提示 'AS'附近有语法错误
SELECT*FROM(SELECTc.Id,d.IdASInventoryCount_Id,c.InventoryCount_Name,d.InventoryCount...
SELECT * FROM(
SELECT
c.Id,
d.Id AS InventoryCount_Id,
c.InventoryCount_Name,
d.InventoryCount_Code AS InventoryCount_Code,
a.Id AS Warehouse_Id,
a.Warehouse_Name AS Warehouse_Name,
c.Warehouse_Code,
b.Id AS Plant_Id,
b.Plant_Name AS Plant_Name,
b.Plant_Code AS Plant_Code,
c.Unit_Code,
c.Unit_Name,
c.Part_Code,
c.Part_Name,
c.Part_Spec,
c.Remark
FROM WM_InventoryCount_Detail c
LEFT JOIN WM_InventoryCount d ON d.InventoryCount_Name = c.InventoryCount_Name
LEFT JOIN Location_Warehouse a ON a.Warehouse_Code = c.Warehouse_Code
LEFT JOIN Location_Plant b ON b.Plant_Code = d.Plant_Code
)T WHERE 1=1
我在sql中运行,就没有问题 展开
SELECT
c.Id,
d.Id AS InventoryCount_Id,
c.InventoryCount_Name,
d.InventoryCount_Code AS InventoryCount_Code,
a.Id AS Warehouse_Id,
a.Warehouse_Name AS Warehouse_Name,
c.Warehouse_Code,
b.Id AS Plant_Id,
b.Plant_Name AS Plant_Name,
b.Plant_Code AS Plant_Code,
c.Unit_Code,
c.Unit_Name,
c.Part_Code,
c.Part_Name,
c.Part_Spec,
c.Remark
FROM WM_InventoryCount_Detail c
LEFT JOIN WM_InventoryCount d ON d.InventoryCount_Name = c.InventoryCount_Name
LEFT JOIN Location_Warehouse a ON a.Warehouse_Code = c.Warehouse_Code
LEFT JOIN Location_Plant b ON b.Plant_Code = d.Plant_Code
)T WHERE 1=1
我在sql中运行,就没有问题 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询