Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

USE [Insurance]

GO
/****** Object: StoredProcedure [dbo].[Net_Premium]
12/25/2013 16:55:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:
<Author,,Name>
-- Create date: <Create Date,,>
-- Description:
<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[Net_Premium]

Script Date:

AS
BEGIN
SET NOCOUNT ON;
Delete from DM_Net_Premium_1
INSERT INTO DM_Net_Premium_1
SELECT [Company_Name]
,[Dates]
,[Line_name]
,[Gross Written Premiums - Gross Written Premium]
,[Claims Paid- Gross]
,[Claims Paid - Net]
,[Net Written Premium]
,[Net Earned Premium]
,[Net Claims Incurred]
,[Retention Rate]
,[Claims Paid - Gross Claims Paid]
,[Total Reserve]
, NULL
,[Unearned Premium Reserve]
,[Outstanding Claims Reserve]
,[Claims IBNR Reserve]
from

[Insurance].[dbo].Fu_NetPremiums()

UPDATE a
SET a.[Total Reserve Prev Q] = b.[Total Reserve]
FROM DM_Net_Premium_1 a
INNER JOIN dbo.DM_Net_Premium_1 b
on a.Company_Name = b.Company_name
and a.Line_Name = b.Line_Name AND b.Dates = DATEADD(quarter, - 1,
a.Dates)
END

You might also like