Res.Comtrade.Citrix.XenDesktop.EndUser.Reports.ReportScript.SessionUserNames.Install (Resource)

Element properties:

TypeResource
File NameComtrade.Citrix.XenDesktop.EndUser.Reports.ReportScript.SessionUserNames.Install.sql
AccessibilityInternal

File Content: Comtrade.Citrix.XenDesktop.EndUser.Reports.ReportScript.SessionUserNames.Install.sql

IF NOT EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'ComtradeMPXAXD_SessionUserNames_DataGet')
BEGIN
EXECUTE ('CREATE PROCEDURE dbo.[ComtradeMPXAXD_SessionUserNames_DataGet] AS RETURN 1')
END
GO

ALTER PROCEDURE [dbo].[ComtradeMPXAXD_SessionUserNames_DataGet]
@AddZeroRow int = 0
AS

--TODO: need to consider ManagementGroupRowId

IF @AddZeroRow = 1
BEGIN
SELECT -1 as UserNameId, '<Add users from the text box below>' as UserName

UNION

SELECT LTUserRowId AS UserNameId, UserName
FROM ComtradeMPXAXD.LTUser
WHERE UserName IS NOT NULL
ORDER BY UserName

END

ELSE
BEGIN
SELECT LTUserRowId AS UserNameId, UserName
FROM ComtradeMPXAXD.LTUser
WHERE UserName IS NOT NULL
ORDER BY UserName

END

GO

/* ===============================================================
PERMISSIONS
=============================================================== */

GRANT EXECUTE ON dbo.[ComtradeMPXAXD_SessionUserNames_DataGet] TO OpsMgrReader

GO