Skip to content

Commit 8684a36

Browse files
committed
Add database name in scripts
1 parent 65650fe commit 8684a36

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

0 Bytes
Binary file not shown.

Tools/Index_rebuild.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
-- Please update the database name to be used !!!
2+
USE [openIMIS-1.5.0];
3+
GO
4+
15
DECLARE @TableName VARCHAR(255)
26
DECLARE @sql NVARCHAR(500)
37
DECLARE @fillfactor INT

Tools/Shift_demo_db_policies_dates.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ BEGIN
22

33
--Update the database to be used
44
use [openIMIS-demo];
5+
GO
56

67
DECLARE @monthShift INT
78

8-
--Get number of months to shift the policy by, using FamilyID 22 which is a renewal example described on the Wiki
9-
SELECT TOP(1) @monthShift = DATEDIFF(month, expirydate, GETDATE()) FROM [tblPolicy] where ValidityTo is NULL
9+
--Get number of months to shift the policy by, using FamilyID 38 which is a renewal example described on the Wiki
10+
SELECT TOP(1) @monthShift = DATEDIFF(MONTH, expirydate, GETDATE()) FROM [tblPolicy] where PolicyID=38
1011

1112
--Shift Enrolldate by @monthShift
1213
UPDATE [tblPolicy] SET EnrollDate = DATEADD(month, @monthShift, EnrollDate)
@@ -21,6 +22,9 @@ BEGIN
2122
--Shift ExpiryDate by @monthShift
2223
UPDATE [tblPolicy] SET ExpiryDate = DATEADD(month, @monthShift, ExpiryDate)
2324

25+
--Update policy status
26+
UPDATE [tblPolicy] SET PolicyStatus = IIF(ExpiryDate<GETDATE(), 8, 2)
27+
2428
--Update InsureePolicy dates
2529
UPDATE IP
2630
SET IP.[EnrollmentDate] = P.[EnrollDate],

0 commit comments

Comments
 (0)