mirror of
https://github.com/bitwarden/server.git
synced 2024-12-10 15:13:29 +01:00
26 lines
482 B
MySQL
26 lines
482 B
MySQL
|
IF OBJECT_ID('[dbo].[OrganizationUser_ReadByUserIds]') IS NOT NULL
|
||
|
BEGIN
|
||
|
DROP PROCEDURE [dbo].[OrganizationUser_ReadByUserIds]
|
||
|
END
|
||
|
GO
|
||
|
|
||
|
CREATE PROCEDURE [dbo].[OrganizationUser_ReadByUserIds]
|
||
|
@UserIds AS [dbo].[GuidIdArray] READONLY
|
||
|
AS
|
||
|
BEGIN
|
||
|
SET NOCOUNT ON
|
||
|
|
||
|
IF (SELECT COUNT(1) FROM @UserIds) < 1
|
||
|
BEGIN
|
||
|
RETURN(-1)
|
||
|
END
|
||
|
|
||
|
SELECT
|
||
|
*
|
||
|
FROM
|
||
|
[dbo].[OrganizationUserView]
|
||
|
WHERE
|
||
|
[UserId] IN (SELECT [Id] FROM @UserIds)
|
||
|
END
|
||
|
GO
|