ALTER procedure [dbo].[proc_PostVisitCountInsert](
@postCount bigint,
@postID bigint)
as
Begin
if not exists(select * from PostVisitCount where [email protected])
Begin
Insert into PostVisitCount(postcount,postID) values(@postCount, @postID)
end
else
Begin
--Query for Update PostVisitCount
Declare @count bigint
Set @count=(select postcount from PostVisitCount where [email protected])
Update PostVisitCount set postcount=(@count+1), [email protected]
End
end --Error getting at this place
當我嘗試執行查詢時,出現這些查詢時出錯。我不明白這個查詢有什麼問題,任何人都能幫我弄清楚我做錯了什麼。關鍵字'結束'附近的語法不正確。 sql
請張貼整個查詢,使一些人可以解析和幫助 – TheGameiswar
你有更新查詢嗎,還是隻有這條評論?開始和結束語句不能爲空;聲明需要在開始和結束之間。 – steenbergh
@TheGameiswar:我添加更新查詢到它不工作顯示相同的錯誤 – user6503334