sql server 存储过程问题

CREATE proc P_Test--创建存储过程P_Test

@pageSize int,--每页数据条数

@pageIndex int,--当前页数(页码)

@pageCount int output,--总的页数,因为需要显示页数,因此是个输出参数
@Key Nvarchar(100)

as

declare @datacount int--总数据条数

select @datacount=count(*) from [dbo].[Book] where Book_Name Like' "%'+@Key+'%"' or Book_JianJie like '"%' + @Key +'%"' --获得总数据条数值并赋给参数

set @pageCount=ceiling(1.0*@datacount/@pageSize)--获得总页数,并赋给参数

--接下来是获得指定页数据
WITH CTE_Search
AS
(
SELECT ,ROW_NUMBER() OVER (ORDER BY Book_Time) AS RowID
FROM Book
WHERE Book_Name Like' "%'+@Key+'%"' or Book_JianJie like '"%' + @Key +'%"'
)
SELECT *
FROM CTE_Search
where RowID between @pageSize
(@pageIndex-1)+1 and @pageSize*@pageIndex

过程 P_Test,第 19 行 Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

请问大家一下这个问题怎么解决呢?


 WITH CTE_Search改成 ;WITH CTE_Search ,注意多一个;号