
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE function [dbo].[GetBankNameFromId](@ID int)
returns char(1000)
as 
begin

	declare @Full_Name as varchar(500)
	if @ID is null or @ID=0 or @ID='' 
	begin
		set @Full_Name='All Agents'
		return @Full_Name;
	end
	set @Full_Name = (	select BANK_NAME from API_BANK_LIST_MASTER  with (nolock) 
					WHERE MASTER_BANK_ID = @ID)
	return @Full_Name
	
end

