update pal_SurfaceField 
set surfaceFieldTypeId = 5, 
relationalFields = '',
relationalSurface = '' 
where surfaceFieldName = 'WholesalerFinalOrderItems_FinalOrderItems_QuotedUnitPrice'
or surfaceFieldName = 'WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderUnitPrice'
or surfaceFieldName = 'WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount'
or surfaceFieldName = 'WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount';

update publ_WholesalerOrderProducts
set WholesalerFinalOrderItems_FinalOrderItems_QuotedUnitPrice = '0'
where WholesalerFinalOrderItems_FinalOrderItems_QuotedUnitPrice is null
or WholesalerFinalOrderItems_FinalOrderItems_QuotedUnitPrice = ''

ALTER TABLE [publ_WholesalerOrderProducts] 
ALTER COLUMN WholesalerFinalOrderItems_FinalOrderItems_QuotedUnitPrice decimal(18,2) NULL;

update publ_WholesalerOrderProducts
set WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderUnitPrice = '0'
where WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderUnitPrice is null
or WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderUnitPrice = ''

ALTER TABLE [publ_WholesalerOrderProducts] 
ALTER COLUMN WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderUnitPrice decimal(18,2) NULL;

update publ_WholesalerOrderProducts
set WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount = '0'
where WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount is null
or WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount = ''

update publ_WholesalerOrderProducts
set WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount = 
REPLACE(WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount, ',', '')
where CHARINDEX(',', WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount, 0) > 0;


ALTER TABLE [publ_WholesalerOrderProducts] 
ALTER COLUMN WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount decimal(18,2) NULL;

update publ_WholesalerOrderProducts
set WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount = '0'
where WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount is null
or WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount = ''

update publ_WholesalerOrderProducts
set WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount = 
REPLACE(WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount, ',', '')
where CHARINDEX(',', WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount, 0) > 0;


ALTER TABLE [publ_WholesalerOrderProducts] 
ALTER COLUMN WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount decimal(18,2) NULL;


INSERT INTO [dbo].[pal_SurfaceGridAggregate]
([surfaceId]
,[surfaceFieldId]
,[aggregateTypeId])
VALUES
(3099
,3188
,1);

INSERT INTO [dbo].[pal_SurfaceGridAggregate]
([surfaceId]
,[surfaceFieldId]
,[aggregateTypeId])
VALUES
(3099
,3202
,1);

INSERT INTO [dbo].[pal_SurfaceGridAggregate]
([surfaceId]
,[surfaceFieldId]
,[aggregateTypeId])
VALUES
(3099
,3213
,1);

INSERT INTO [dbo].[pal_SurfaceGridAggregate]
([surfaceId]
,[surfaceFieldId]
,[aggregateTypeId])
VALUES
(3099
,3214
,1);