USP_SEARCH_CORRESPONDENCEPROCESS
Search screen for finding correspondence processes.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@NAME | nvarchar(100) | IN | Name |
@DESCRIPTION | nvarchar(255) | IN | Description |
@SELECTIONID | uniqueidentifier | IN | Selection |
@CORRESPONDENCECODEID | uniqueidentifier | IN | Correspondence Code |
@MAXROWS | smallint | IN | Input parameter indicating the maximum number of rows to return. |
Definition
Copy
CREATE procedure dbo.USP_SEARCH_CORRESPONDENCEPROCESS(
@NAME nvarchar(100) = null,
@DESCRIPTION nvarchar(255) = null,
@SELECTIONID uniqueidentifier = null,
@CORRESPONDENCECODEID uniqueidentifier = null,
@MAXROWS smallint = 500
)
as
select top(@MAXROWS)
cp.ID,
cp.NAME NAME,
cp.DESCRIPTION DESCRIPTION,
isr.NAME SELECTION,
cc.NAME CORRESPONDENCECODE
from CORRESPONDENCEPROCESS cp
left join CORRESPONDENCECODE cc on cp.CORRESPONDENCECODEID = cc.ID
left join IDSETREGISTER isr on cp.IDSETREGISTERID = isr.ID
where (@NAME is null or (cp.NAME like '%' + @NAME + '%')) and
(@DESCRIPTION is null or (cp.DESCRIPTION like '%' + @DESCRIPTION + '%')) and
(@SELECTIONID is null or (isr.ID = @SELECTIONID)) and
(@CORRESPONDENCECODEID is null or (cc.ID = @CORRESPONDENCECODEID))