1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
bitwarden-server/util/Migrator/DbScripts/2021-05-11_00_BulkReinvite.sql
Oscar Hinton e2f633dace
Bulk re-invite of org users (#1316)
* Add APIs for Bulk reinvinte

* Resolve review comments.
2021-05-12 11:18:25 +02:00

25 lines
453 B
Transact-SQL

IF OBJECT_ID('[dbo].[OrganizationUser_ReadByIds]') IS NOT NULL
BEGIN
DROP FUNCTION [dbo].[OrganizationUser_ReadByIds]
END
GO
CREATE PROCEDURE [dbo].[OrganizationUser_ReadByIds]
@Ids AS [dbo].[GuidIdArray] READONLY
AS
BEGIN
SET NOCOUNT ON
IF (SELECT COUNT(1) FROM @Ids) < 1
BEGIN
RETURN(-1)
END
SELECT
*
FROM
[dbo].[OrganizationUserView]
WHERE
[Id] IN (SELECT [Id] FROM @Ids)
END