57 lines
1.9 KiB
Transact-SQL
57 lines
1.9 KiB
Transact-SQL
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
|