Template SQL Script for Order ID Index Values

Use the template below to load the RootID and Guid values for an order if you have the order number. Add your custom code to the “Queries” section. The code shows an example that displays the Settlement Date for the specified order number.

-- Get index id values for an order.

declare @orderNumber as varchar(30) = 'XAT24002476'  -- Enter order number here.

-- Calculated values
declare @orderRootid as integer = (select RootID from [pf].[Order] where Number = @orderNumber)
declare @orderGuid as uniqueidentifier = (select Guid from [pf].[Order] where Number = @orderNumber)
select @orderNumber as 'orderNumber', @orderRootid as 'orderRootid', @orderGuid as 'orderGuid'

-- Queries...

select [SettlementDate] from [pf].[OrderInfo] where RootID = @orderRootid