The core infrastructure backend (API, database, Docker, etc).
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.
 
 
 
 
 
 

20 lines
499 B

CREATE OR ALTER PROCEDURE [dbo].[SecurityTask_ReadByOrganizationIdStatus]
@OrganizationId UNIQUEIDENTIFIER,
@Status TINYINT = NULL
AS
BEGIN
SET NOCOUNT ON
SELECT
ST.*
FROM
[dbo].[SecurityTaskView] ST
INNER JOIN
[dbo].[Organization] O ON O.[Id] = ST.[OrganizationId]
WHERE
ST.[OrganizationId] = @OrganizationId
AND O.[Enabled] = 1
AND ST.[Status] = COALESCE(@Status, ST.[Status])
ORDER BY ST.[CreationDate] DESC
END
GO