Stored Procedures [dbo].[MssWebGetSmsOrderLevelInformation]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOrderIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
create procedure [dbo].[MssWebGetSmsOrderLevelInformation]
    @inOrderId int
as
begin
set nocount on
    select
    SakariAccountPriKey = SakariAccount.SakariAccountID,
    SakariAccountId = SakariAccount.AccountId,
    OrderNumber =
        coalesce(
            Orders.OrderNo,
            Orders.ArchivedOrderNo + '[A]',
            dbo.FormatFirstNameLastName(Orders.LastName, Orders.FirstName ) ),
    CustomerName = dbo.FormatFirstNameLastName(Orders.LastName, Orders.FirstName )
    from Orders
    inner join Branch on Orders.BranchPriKey = Branch.BranchPriKey
    left outer join SakariAccountBranchMap on Branch.BranchPriKey = SakariAccountBranchMap.BranchFID
    left outer join SakariAccount on SakariAccountBranchMap.SakariAccountFID = SakariAccount.SakariAccountID
    where Orders.PriKey =@inOrderId
end
GO
GRANT EXECUTE ON  [dbo].[MssWebGetSmsOrderLevelInformation] TO [MssExec]
GO
Uses