我有以下 SQL:
ALTER PROCEDURE [dbo].[usp_gettasks]
@ID varchar(50)
AS
declare @PDate Date
WHILE (DATEPART(DW, @PDate) = 1 OR DATEPART(DW, @PDate) = 7 )
BEGIN
set @PDate = DATEADD(day, 1, @PDate)
END
CREATE VIEW tblList AS
select tt.ItemOrder,tt.DisplayVal, DATEADD(day, tt.DaysDue, @PDate) from tblLine tt
where tt.ID = 1
我收到以下消息:
语法不正确:“Create VIEW”必须是批处理中的唯一语句
GO
我之前试过 put Create View
,但后来它无法识别PDate
.