mirror of
https://github.com/bitwarden/server.git
synced 2024-11-30 13:33:24 +01:00
7a209aa3bb
* Add support for revoking access tokens
24 lines
500 B
Transact-SQL
24 lines
500 B
Transact-SQL
CREATE OR ALTER PROCEDURE [dbo].[ApiKey_DeleteByIds]
|
|
@Ids [dbo].[GuidIdArray] READONLY
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
|
|
DECLARE @BatchSize INT = 100
|
|
|
|
WHILE @BatchSize > 0
|
|
BEGIN
|
|
BEGIN TRANSACTION ApiKey_DeleteMany
|
|
|
|
DELETE TOP(@BatchSize) AK
|
|
FROM
|
|
[dbo].[ApiKey] AK
|
|
INNER JOIN
|
|
@Ids I ON I.Id = AK.Id
|
|
|
|
SET @BatchSize = @@ROWCOUNT
|
|
|
|
COMMIT TRANSACTION ApiKey_DeleteMany
|
|
END
|
|
END
|