Project

General

Profile

Bug #1701 » PDSCUSTROLEID.sql

Tri Rizqiaty, 10/18/2022 10:07 AM

 
1
??USE [MinovaES_BankFama_Prod]
2

3
GO
4

5
/****** Object:  StoredProcedure [dbo].[PDSCUSTROLEID]    Script Date: 18/10/2022 09.52.21 ******/
6

7
SET ANSI_NULLS ON
8

9
GO
10

11
SET QUOTED_IDENTIFIER ON
12

13
GO
14

15
ALTER PROCEDURE [dbo].[PDSCUSTROLEID]
16

17
(
18

19
	@RoleID VARCHAR(250)
20

21
	,@RoleDescription VARCHAR(250)
22

23
	,@CompanyID VARCHAR(8)
24

25
)
26

27
AS
28

29

30

31
--DECLARE @RoleID VARCHAR(250) = ''
32

33
--DECLARE @RoleDescription VARCHAR(250) = ''
34

35
--DECLARE @CompanyID VARCHAR(8) = '1000'
36

37

38

39
SELECT StartDate, EndDate, RoleID, RoleDescription, CASE WHEN CompanyID = '*' THEN @CompanyID ELSE CompanyID END CompanyID, Notes, CreateBy, CreateDate, ChangeBy, ChangeDate FROM PCUSTROLEID 
40

41
WHERE (CompanyID = @CompanyID OR CompanyID = '*' OR @CompanyID = '')
42

43
	AND (RoleID like @RoleID OR @RoleID = '')
44

45
	AND (RoleDescription like @RoleDescription OR @RoleDescription = '')
(3-3/3)