It's first time to work on sql server. i am getting error at "END" as "incorrect syntax near END". suppose if i remove "limit 20", its not sowing error. how can i fix it. my proc:
ALTER PROCEDURE [dbo].[GettotalApps]
AS
BEGIN
SET XACT_ABORT ON
SET NOCOUNT ON
SELECT
v.appId,
v.Description,
(SELECT COUNT(appidorchannelid)
FROM ratings r
WHERE r.AppIdOrChannelId = v.channelid) AS Channelvotes
FROM
apps v
WHERE
v.ChannelStatusId = 1
AND v.IsChannelPrivate = 0
ORDER BY
SubscriberCount DESC
limit 20
END