The insert procedure was copying last years stock status table.
Now it is generating a new one every time a stock is uploaded:
--------------------------------------- Import the SAG StockTable if already exists ------------------------------------
/ REMOVED BECAUSE IT WAS COPYING THE TABLE OF LAST YEAR (CARLOS AND DAVID REMOVED THIS FEATURE IN THE 30 OF APRIL OF 2018 )
if (@PreviousStockKey > 0)
BEGIN
IF EXISTS (SELECT FROM tblStockStatusLines WHERE (AssessmentKey = @PreviousStockKey) )
BEGIN
INSERT INTO [dbo].[tblStockStatusLines]
([AssessmentKey],[linenumber],[LineDescription],[FishingPressureLabel],[FishingPressureStatus],[StockSizeLimitLabel],[StockSizeStatus],[CustomLabel],[CustomStatus])
SELECT @id AS [AssessmentKey], linenumber, LineDescription, FishingPressureLabel, FishingPressureStatus, StockSizeLimitLabel, StockSizeStatus, CustomLabel, CustomStatus
FROM tblStockStatusLines
WHERE (AssessmentKey = @PreviousStockKey)
INSERT INTO [dbo].[tblStockStatusColumns]
([AssessmentKey],[Year],[linenumber],[ColumnType],[status])
SELECT @id , Year, linenumber, ColumnType, status
FROM tblStockStatusColumns
WHERE (AssessmentKey = @PreviousStockKey)
END
ELSE
BEGIN
EXEC [dbo].[up_createDefaultStockStatus] @AssessmentKey = @ID, @user = @user
END
The insert procedure was copying last years stock status table. Now it is generating a new one every time a stock is uploaded:
--------------------------------------- Import the SAG StockTable if already exists ------------------------------------
/ REMOVED BECAUSE IT WAS COPYING THE TABLE OF LAST YEAR (CARLOS AND DAVID REMOVED THIS FEATURE IN THE 30 OF APRIL OF 2018 ) if (@PreviousStockKey > 0) BEGIN IF EXISTS (SELECT FROM tblStockStatusLines WHERE (AssessmentKey = @PreviousStockKey) ) BEGIN INSERT INTO [dbo].[tblStockStatusLines] ([AssessmentKey],[linenumber],[LineDescription],[FishingPressureLabel],[FishingPressureStatus],[StockSizeLimitLabel],[StockSizeStatus],[CustomLabel],[CustomStatus]) SELECT @id AS [AssessmentKey], linenumber, LineDescription, FishingPressureLabel, FishingPressureStatus, StockSizeLimitLabel, StockSizeStatus, CustomLabel, CustomStatus FROM tblStockStatusLines WHERE (AssessmentKey = @PreviousStockKey)
END */