SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[qryMMSChartOfAccounts_ListAllByType]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[qryMMSChartOfAccounts_ListAllByType]
GO

CREATE PROCEDURE [qryMMSChartOfAccounts_ListAllByType]
	@AccountUsage INT
AS

SELECT lca.LedgerChartOfAccountsID, lca.GLAccountNumber, lca.GLAccountName, lcac.Country, lca.MxSortOrder, lca.IsActive
FROM  LedgerChartOfAccounts lca
	INNER JOIN [LedgerChartOfAccountsCountry] lcac ON lcac.GLAccountNumber = lca.GLAccountNumber
WHERE MxAccountUsage=@AccountUsage

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
