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]' ) ,
    CustomerName = dbo.FormatFirstNameLastName(Orders.FirstName,Orders.LastName)
    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