2017-03-06 20:51:13 -05:00
|
|
|
|
CREATE VIEW [dbo].[OrganizationUserUserDetailsView]
|
2017-03-04 21:28:41 -05:00
|
|
|
|
AS
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
OU.[Id],
|
|
|
|
|
|
OU.[UserId],
|
|
|
|
|
|
OU.[OrganizationId],
|
|
|
|
|
|
U.[Name],
|
|
|
|
|
|
ISNULL(U.[Email], OU.[Email]) Email,
|
2018-12-19 11:48:36 -05:00
|
|
|
|
U.[TwoFactorProviders],
|
|
|
|
|
|
U.[Premium],
|
2017-03-04 21:28:41 -05:00
|
|
|
|
OU.[Status],
|
2017-04-20 23:50:12 -04:00
|
|
|
|
OU.[Type],
|
2017-05-15 23:03:32 -04:00
|
|
|
|
OU.[AccessAll],
|
2020-07-28 21:11:45 -04:00
|
|
|
|
OU.[ExternalId],
|
|
|
|
|
|
SU.[ExternalId] SsoExternalId
|
2017-03-04 21:28:41 -05:00
|
|
|
|
FROM
|
|
|
|
|
|
[dbo].[OrganizationUser] OU
|
|
|
|
|
|
LEFT JOIN
|
2020-07-28 21:11:45 -04:00
|
|
|
|
[dbo].[User] U ON U.[Id] = OU.[UserId]
|
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
|
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId]
|