﻿CREATE PROCEDURE [account].[GetPayeSchemes_ByAccountId]
	@accountId BIGINT
AS
	SELECT 
		* 
	FROM 
		[account].[Paye] p
	inner join 
		[account].[AccountHistory] ah on ah.PayeRef = p.Ref
	WHERE
		ah.AccountId = @accountId


﻿CREATE PROCEDURE [account].[GetPayeSchemes_ByAccountId]
	@accountId BIGINT
AS
	SELECT 
		* 
	FROM 
		[account].[Paye] p
	inner join 
		[account].[AccountHistory] ah on ah.PayeRef = p.Ref
	WHERE
		ah.RemovedDate is null and ah.AccountId = @accountId


Update to stored procedure for getting paye scheme information for an account to not make it get scheme information for schemes that have been removed
Update to stored procedure for getting paye scheme information for an account to not make it get scheme information for schemes that have been removed
