1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-02 13:53:23 +01:00
bitwarden-server/util/Migrator/DbScripts/2024-09-11_00_OrganizationTransactionsReadCursor.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
422 B
MySQL
Raw Normal View History

CREATE OR ALTER PROCEDURE [dbo].[Transaction_ReadByOrganizationId]
@OrganizationId UNIQUEIDENTIFIER,
@Limit INT,
@StartAfter DATETIME2 = NULL
AS
BEGIN
SET NOCOUNT ON
SELECT
TOP (@Limit) *
FROM
[dbo].[TransactionView]
WHERE
[OrganizationId] = @OrganizationId
AND (@StartAfter IS NULL OR [CreationDate] < @StartAfter)
ORDER BY
[CreationDate] DESC
END