0
안녕하세요 SP에서 피벗을 사용하고 있지만이이 저장 프로 시저
GO
/****** Object: StoredProcedure [dbo].[Ascend_sp_rpt_CashierTransactionAmt] Script Date: 07/23/2016 12:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Venkat>
-- Create date: <Create Date,23-07-2016,>
-- Description: <Description,Cashier Transaction Amount Reports ,>
-- =============================================
ALTER PROCEDURE [dbo].[Ascend_sp_rpt_CashierTransactionAmt]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT * FROM(
SELECT
b.Sale_Rate,b.Type,b.Type_Code,CASE
WHEN 1=0 then convert(char(19),b.LogTime,20)
ELSE convert(char(10),b.LogTime,20)
END 'LogDate' from tbllog b)a
PIVOT
(
Sum(Sale_Rate)
FOR Type IN ([S], [D], [C])
) AS P
END
을 실행할 수있는 오류 무엇 오류가 표시 나는 그것이 실행 된 CASE 문을 제거
Msg 208, Level 16, State 6, Procedure Ascend_sp_rpt_CashierTransactionAmt, Line 14
Invalid object name 'dbo.Ascend_sp_rpt_CashierTransactionAmt'.
로 왜 그런지 몰라.
쿼리가 정확합니다. sp의 모든 코드 표시 – NEER
이전에이 sp를 변경하려고 시도한 적이 있습니까? sp의'END' 뒤에'exec' 예제가 있습니까? sp 코드와이 sp를 사용하는 코드 사이에'GO '를 넣으십시오. –