﻿USE [AIADatabaseV5]
GO
/****** Object:  StoredProcedure [dbo].[GetAccountModule]    Script Date: 2/1/2018 12:15:55 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		madan.prajapati@magicsw.com
-- Create date: 10/12/2010
-- Description:	Fetch Module value corresponding to given account Id
-- =============================================

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

CREATE PROCEDURE [dbo].[GetAccountModule] 
	-- Add the parameters for the stored procedure here
	@LicenseId int = 0
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Select statements for procedure here
Select ModuleToLicense.Id, ResourceModule.Title,ModuleToLicense.Status from dbo.ModuleToLicense,ResourceModule 
	WHERE ModuleToLicense.ModuleId = ResourceModule.Id AND ModuleToLicense.LicenseId = @LicenseId 
		AND ResourceModule.Status = 1

END

GO
