I am creating a Sales Report that exports to CSV to be imported into an EDI system. The query pulls detail records using @SalesOrder as the parameter. I have a need to increment a shipment number and Container ID for each SalesOrder # the query executes against. This is just a temporary solution to move inventory. Once completed I'll have no need for this. So I'm looking for the easiest solution.
DECLARE @SalesOrder INT;
SET @SalesOrder = '830901';
SELECT DTL = 'DTL' ,
ShipmentNumber = 'Begin with 50000 and increment' ,
ContainerID = 'Begin with PORTCONTAINER1 and increment',
FROM [dataKLL].[dbo].[KLL Sales Order Summary] ORD
WHERE ord_num = @SalesOrder;