Morska plugins refactor
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
DECLARE @JustForDebug TINYINT = 0;
|
||||
|
||||
-- SETUP VARIABLES
|
||||
DECLARE @Number INT = (SELECT COUNT(id) + 1 FROM [diunabi-morska].[dbo].[Layers]);
|
||||
DECLARE @Number INT = (SELECT COUNT(id) + 1 FROM [DiunaBI-PedrolloPL].[dbo].[Layers]);
|
||||
DECLARE @Name NVARCHAR(50) = CONCAT(
|
||||
'L', @Number, '-D-D6-SELL-CODES'
|
||||
'L', @Number, 'D-P2-CODES'
|
||||
);
|
||||
DECLARE @LayerId UNIQUEIDENTIFIER = NEWID();
|
||||
|
||||
@@ -16,7 +16,7 @@ BEGIN
|
||||
RETURN;
|
||||
END;
|
||||
|
||||
INSERT INTO [diunabi-morska].[dbo].[Layers]
|
||||
INSERT INTO [DiunaBI-PedrolloPL].[dbo].[Layers]
|
||||
([Id], [Number], [Name], [CreatedAt], [ModifiedAt], [IsDeleted], [CreatedById], [ModifiedById], [Type])
|
||||
VALUES (@LayerId, @Number, @Name, GETDATE(), GETDATE(), 0, '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 3);
|
||||
|
||||
@@ -27,16 +27,23 @@ DECLARE @Array TABLE (
|
||||
|
||||
INSERT INTO @Array (Code, Desc1)
|
||||
VALUES
|
||||
('1002', '1102'),
|
||||
('1003','1202'),
|
||||
('1008','1302'),
|
||||
('1009','1302'),
|
||||
('9085','1203'),
|
||||
('1010','1304'),
|
||||
('9086','1005'),
|
||||
('1021','1206'),
|
||||
('9089','1207'),
|
||||
('9091','1208')
|
||||
('01','<nieznany>'),
|
||||
('02','DOLNOŚLĄSKIE'),
|
||||
('03','KUJAWSKO-POMORSKIE'),
|
||||
('04','LUBELSKIE'),
|
||||
('05','LUBUSKIE'),
|
||||
('06','ŁÓDZKIE'),
|
||||
('07','MAŁOPOLSKIE'),
|
||||
('08','MAZOWIECKIE'),
|
||||
('09','OPOLSKIE'),
|
||||
('10','PODKARPACKIE'),
|
||||
('11','PODLASKIE'),
|
||||
('12','POMORSKIE'),
|
||||
('13','ŚLĄSKIE'),
|
||||
('14','ŚWIĘTOKRZYSKIE'),
|
||||
('15','WARMIŃSKO-MAZURSKIE'),
|
||||
('16','WIELKOPOLSKIE'),
|
||||
('17','ZACHODNIOPOMORSKIE');
|
||||
|
||||
-- Loop through the array and insert into the target table
|
||||
DECLARE @Code NVARCHAR(50);
|
||||
@@ -51,7 +58,7 @@ FETCH NEXT FROM CursorArray INTO @Code, @Desc1;
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
INSERT INTO [diunabi-morska].[dbo].[Records]
|
||||
INSERT INTO [DiunaBI-PedrolloPL].[dbo].[Records]
|
||||
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
|
||||
VALUES (NEWID(), @Code, @Desc1, GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, @LayerId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user