Files
DP44/DataPRO_sql/.svn/pristine/f3/f3bf669700de022caf7ba69db82cd95fb7a08890.svn-base
2026-04-17 14:55:32 -04:00

57 lines
1.9 KiB
Plaintext

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_UserUIItemSettingsGet]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[sp_UserUIItemSettingsGet]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_UserUIItemSettingsGet]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_UserUIItemSettingsGet] AS'
END
GO
ALTER PROCEDURE [dbo].[sp_UserUIItemSettingsGet]
@UserId int = null
AS
BEGIN
SET NOCOUNT ON;
SELECT Settings.[UserID]
, Settings.[UIItemID]
, Settings.[Permission]
, Settings.[Visible]
, Items.[NAME]
FROM [dbo].[UIItemSettings] as Settings INNER JOIN [dbo].[UIItems] as Items on Settings.UIItemID = Items.ID
where @UserId is null or Settings.[UserID] = @UserId
END
GO