存储过程返回一个int值而不是列

时间:2014-07-28 15:37:07

标签: c# sql entity-framework stored-procedures

我有一个我无法访问的人编写的存储过程。当我添加存储过程时,我得到下面的定义告诉我我返回一个int值(-1)。为什么我返回int而不是行?当我从Visual Studio 2012 Server Explorer执行sp时,它会重新输出相应的输出,如下所示。我正在使用实体框架

我看到了这个post,但我不确定复杂性是多么复杂,因为它说sp可能很复杂。

enter image description here

enter image description here 这是存储的Proc

@Start_Date AS DATETIME,
@End_Date AS DATETIME 

AS

SELECT DLY.[GroupName]
    ,SUM(DLY.[Sales]) AS 'Sales'
    --,[Order Date]

FROM


(SELECT NDO.[No_]
      ,NDO.[Item Category]
      ,CAST(NDO.[Amount]-NDO.[Amount VOID] AS DECIMAL(10,2)) AS 'Sales'
     ,NDO.[Entry Date] AS 'Order Date'
     ,'GroupName'=
     CASE
        WHEN NDO.[No_] = '' THEN('UNKNOWN')
        --WHEN NDO.[Item Category] IS NOT NULL AND [Item Reporting Category Code] IS NULL THEN(NDO.[No_])
        WHEN [Item Reporting Category Code] IS NULL THEN(NDO.[No_])
        ELSE [Item Reporting Category Code]
     END
  --INTO #Sales_Lines
  FROM [Protective LIVE$Net Daily Orders] NDO LEFT JOIN [dbo].[Protective LIVE$Item] I ON NDO.[No_] = I.[No_] ) AS DLY
  WHERE DLY.[Order Date] BETWEEN @Start_Date AND @End_Date
  AND DLY.Sales <> '0'
  --WHERE DLY.Sales <> '0'
  GROUP BY DLY.[GroupName]

0 个答案:

没有答案