ALTER PROCEDURE [dbo].[Sp_GetEmailForMailing]
-- Add the parameters for the stored procedure here
@end int=1000
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 top(500) RegistrationID, EmailID from dbo.Candidate_RegistrationData
where status_flag=1 and payment_status=2
and RegistrationID NOT IN (SELECT top(@end) RegistrationID from dbo.Candidate_RegistrationData
where status_flag=1 and payment_status=2) order by RegistrationID
END
This is my stored procedure. In this I want rows from 500 but I am getting from 250 row number.... any one have idea why it happen...thank you