You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
822 B
32 lines
822 B
CREATE OR ALTER VIEW [dbo].[OrganizationUserUserDetailsView] |
|
AS |
|
SELECT |
|
OU.[Id], |
|
OU.[UserId], |
|
OU.[OrganizationId], |
|
U.[Name], |
|
ISNULL(U.[Email], OU.[Email]) Email, |
|
U.[AvatarColor], |
|
U.[TwoFactorProviders], |
|
U.[Premium], |
|
OU.[Status], |
|
OU.[Type], |
|
OU.[AccessAll], |
|
OU.[ExternalId], |
|
SU.[ExternalId] SsoExternalId, |
|
OU.[Permissions], |
|
OU.[ResetPasswordKey], |
|
U.[UsesKeyConnector] |
|
FROM |
|
[dbo].[OrganizationUser] OU |
|
LEFT JOIN |
|
[dbo].[User] U ON U.[Id] = OU.[UserId] |
|
LEFT JOIN |
|
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId] |
|
GO |
|
|
|
IF OBJECT_ID('[dbo].[OrganizationUserUserDetails_ReadByOrganizationId]') IS NOT NULL |
|
BEGIN |
|
EXECUTE sp_refreshsqlmodule N'[dbo].[OrganizationUserUserDetails_ReadByOrganizationId]'; |
|
END |
|
GO
|
|
|