Stored Procedures [dbo].[GetCommStmtHeaderInformation]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@userIdForBestTimeZonevarchar(32)32
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE PROCEDURE [dbo].[GetCommStmtHeaderInformation]
    @userIdForBestTimeZone varchar(32)

AS
begin
    set nocount on

    declare @outBestTimeZone varchar(32);
    exec GetBestUserTimeZoneName
        @inSysUserId = @userIdForBestTimeZone,
        @inGetServerTimeZoneIfNeeded = 1,
        @outBestTimeZone = @outBestTimeZone output
    
    
    select
        CommStmtHeader.MSID,
        CommStmtHeader.VendorClassID,
        CommStmtHeader.VendorClass,
        CommStmtHeader.DateCreated,
        CommStmtHeader.ToDate,
        CommStmtHeader.Final,
        CommStmtHeader.FinalizedOn,
        FinalizedOnConvertedToLocal = dbo.ConvertUtcToFirstBestTimeZone( CommStmtHeader.FinalizedOn, @outBestTimeZone ),
        CommStmtHeader.FinalizedBy,
        CommStmtHeader.CreatedBy,
        CreatedByName = dbo.FormatFirstNameLastName(CreatedBy.FIRSTNAME, CreatedBy.LASTNAME),
        FinalizedByName = dbo.FormatFirstNameLastName(FinalizedBy.FIRSTNAME, FinalizedBy.LASTNAME)
    from CommStmtHeader
    left outer join Sysuser as CreatedBy on CreatedBy.SysUserID = CommStmtHeader.CreatedBy
    left outer join Sysuser as FinalizedBy on CommStmtHeader.FinalizedBy = FinalizedBy.SysUserID
end
GO
GRANT EXECUTE ON  [dbo].[GetCommStmtHeaderInformation] TO [MssExec]
GO
Uses