Stored Procedures [dbo].[spRevenueGetItems_Legacy]
Properties
PropertyValue
ANSI Nulls OnNo
Quoted Identifier OnNo
Parameters
NameData TypeMax Length (Bytes)
@RevGroupPriKeyint4
@inOrderIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
/*
* Don't use this stored proc directly but instead use spRevenueGetItems_Synonym.
* spRevenueGetItems_Synonym will either point to this stored proc or to
* spRevenueGetItems_XLedger if that is active.
*
*
*    Description: ItemCodes that are associated to @RevGroupPriKey.
*
*    @params:
*    @RevGroupPriKey: The revenue entry primary key used to limit which item codes are returned.
*    @inOrderId: The primary key for the current order (not used by this stored proc).
*
*/


CREATE PROCEDURE [dbo].[spRevenueGetItems_Legacy]
    @RevGroupPriKey int,
    @inOrderId int
as
set nocount on

select
    ItemCode.ICPriKey,
    ItemCode.ItemCode,
    ItemCode.[Description],
    Service = str( ItemCode.ItemCode ) + ' - ' + ItemCode.[Description],
    SplitGroup = 0
from ItemCode
where ItemCode.RGPriKey = @RevGroupPriKey
union all
select
    ItemCode.ICPriKey,
    ItemCode.ItemCode,
    ItemCode.[Description],
    Service = str( ItemCode.ItemCode ) + ' - ' + ItemCode.[Description],
    SplitGroup = 1
from RevGroups
inner join ItemCode on RevGroups.ICPriKey = ItemCode.ICPriKey
where RevGroups.RGPriKey = @RevGroupPriKey
GO
GRANT EXECUTE ON  [dbo].[spRevenueGetItems_Legacy] TO [MssExec]
GO
Uses
Used By