canersaritac 9:21 AM
DECLARE @salesOrderId Bigint
DECLARE @supplyOrderId Bigint

select top 1 @salesOrderId = iTransaction_num from tbTransactionSalesOrder with (nolock) where EntityID=1810 order by iTransaction_num desc
select  * from tbTransactionSalesOrder with (nolock) where iTransaction_num = @salesOrderId
select  * from tbTransactionSalesOrderDetail with (nolock) where iTransaction_num = @salesOrderId
select  top 1 * from tbTransactionSupplyOrder with (nolock) where TransactionSalesOrderId = @salesOrderId
select  top 1 @supplyOrderId = iTransaction_num from tbTransactionSupplyOrder with (nolock) where TransactionSalesOrderId = @salesOrderId
select  * from tbTransactionSupplyOrderDetail with (nolock) where iTransaction_num = @supplyOrderId