
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_act_accounts_lst]
	@actor_id as int,
	@account_number varchar(50) = '%'
AS

set nocount on

select	a.*, 
		b.adr_name, b.adr_complete_name, b.act_internal_reference, b.act_actor_id,
		c.*
from act_accounts a
	inner join vw_act_banks b on act_actor_id = acc_bank_id
	inner join acc_currencies c on acc_currency_code = cur_currency_code
where	acc_actor_id = @actor_id
		and ( @account_number = '%' or acc_account_number = @account_number)
		



GO
