You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.5 KiB

  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: UserDefinedFunction [dbo].[GetBranchName] Script Date: 2/29/2024 5:15:23 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. -- =============================================
  9. -- Author: <Author,,Name>
  10. -- Create date: <Create Date, ,>
  11. -- Description: <Description, ,>
  12. -- =============================================
  13. ALTER function [dbo].[GetBranchName](@ID int)
  14. returns char(1000)
  15. as
  16. begin
  17. declare @Full_Name as varchar(500)
  18. if @ID is null or @ID=0 or @ID=''
  19. begin
  20. set @Full_Name='All Agents'
  21. return @Full_Name;
  22. end
  23. SELECT @Full_Name = BRANCH_NAME + ' - ' + BRANCH_CODE1
  24. FROM API_BANK_BRANCH_LIST WITH (NOLOCK)
  25. WHERE BRANCH_ID = @ID
  26. return @Full_Name
  27. end