USE [Clinica]
GO
/****** Object:  View [Core].[VWUsuarioRol]    Script Date: 18-08-2025 21:38:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [Core].[VWUsuarioRol] AS
SELECT
	u.IdUsuario, u.LoginName, p.IdPerfil, p.Descripcion as Perfil, r.IdRol, r.Codigo, r.Descripcion as Rol
FROM Core.Usuario u
JOIN Core.Perfil p on u.IdPerfil = p.IdPerfil
JOIN Core.RolPorPerfil rp on p.IdPerfil = rp.IdPerfil
JOIN Core.Rol r ON rp.IdRol = r.IdRol
GO
