SQLTeam.com | Weblogs | Forums

Create dynamic pivot query to report number of products per month per company group with totals per product and per company


#1

Should create a dynamic pivot table to report products sold monthly by company group.

  • There are several products and each company group might have a different combination of them.
  • The product status are Active and Cancelled.
  • The Active products are counted using the date where they were billed (dbilldate) and the cancelled should be counted using dtContractCancelledDate.
  • There are some cases where the company group does not sell or cancel a product during the month so all the column should reflect that (look on Prod2 Cancelled).
    A calculation column should exist to calculate the net per product (Prod Active – Prod Cancelled).

We need help

• Creating different calculation to count the product active and cancelled using the corresponding dates (dbilled and dtcancelledbilled)

• Creating a column with 0s when there are not sold/cancelled products

• Creating the net columns for each product

• Creating the subtotals at the end of each column

This is the result desired:
Pd1Actv Pd1Cancd Pd1Net Prd2Actv Prd2Cancd Prd2Net Total
Comp1 6 5 1 15 0 15 16
Comp2 20 6 14 39 0 39 53
Comp3 63 14 49 82 0 82 131
Total 89 25 64 136 0 136 200

This is the main table from where data is extracted

'SELECT [iCompId],[sContractStatusCode],[sContractStatusDesc],[dBillDate] ,dtContractCancelledBilled FROM [Contract_Header]'

This is what I have until now:

DECLARE 
@cols AS NVARCHAR(MAX),
@query  AS NVARCHAR(MAX),
@Compgroupnumber as varchar(20),
@startdate as date,
@enddate as date

set @startdate=cast(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-1, 0) as
date)
set @enddate=DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))
set @sCompGroupNumber ='DG10000174'

select @cols = 
STUFF((SELECT distinct  ',' + QUOTENAME(h.sProductCode+'
 '+sContractStatusDesc) 
from [Contract_Header] h
inner join [Comp_Header] d on d.iid=h.icompId
inner join [Comp_CompGroupLink] dgl on d.iId=dgl.CompId
inner join [Comp_DealerGroups] dg on dgl.iCompGroupId=dg.iId
where  (h.sContractStatusCode='A' or h.sContractStatusCode='C') and
(h.dBillDate between @startdate and @enddate)  and
sCompGroupNumber='DG10000174' and 
h.sProductCode in
(                     
  select distinct t.sProductCode
  from [Contract_Header] t
  inner join [Comp_Header] d on d.iid=t.iDealerId
  inner join [Comp_CompGroupLink] dgl on d.iId=dgl.iCompId
  inner join [Comp_CompGroups] dg on dgl.iDealerGroupId=dg.iId
  where  (t.sContractStatusCode='A' or t.sContractStatusCode='C') and
 (t.dBillDate between @startdate and @enddate)  and
  sCompGroupNumber='DG10000174' 
  )FOR XML PATH('')) ,1,1,'')

set @query= 
'SELECT sCompName,' + @cols + ' , +Total
 from 
(
select d.sCompName,
 col = c.sProductCode+'' ''+c.sContractStatusDesc,c.sContractStatusCode,
from [Contract_Header] c
 inner join [Comp_Header] d on d.iid=c.iDealerId
 inner join [Comp_CompGroupLink] dgl on d.iId=dgl.iCompId
 inner join [Comp_CompGroups] dg on dgl.iCompGroupId=dg.iId
 where (dBillDate between '''+CAST(@startdate AS varchar)+''' and 
         '''+CAST(@enddate AS VARCHAR)+''') and 
		sCompGroupNumber='''+'DG10000174'+''' and  
		(c.sContractStatusCode='''+'A'+''' or 
         c.sContractStatusCode='''+'C'+''' ) and 
            sproductcode in

            (select distinct sProductCode 
	         from [Contract_Header] t 
		      inner join [Comp_Header] d on d.iid=t.iCompId
		      inner join [Comp_CompGroupLink] dgl on d.iId=dgl.iCompId
              inner join [Comp_CompGroups] dg on dgl.iCompGroupId=dg.iId
		      where (dBillDate between '''+CAST(@startdate AS varchar)+''' 
              and '''+CAST(@enddate AS VARCHAR)+''') and   		   	 
              (t.sContractStatusCode='''+'A'+''' or 
               t.sContractStatusCode='''+'C'+''' ) and 
     	       sCompGroupNumber='''+'DG10000174'+''' 
             ) 
      )  as DataSource
        pivot 
        (
            Count(sContractStatusCode)
            for col in (' + @cols + ')
        ) p order by sCompName' 

execute sp_executesql @query

This is the result of the query above
Pd1Actv Pd1Cancd Pd2Actv Pd3Actv
Comp 1 59 0 59 118
Comp 2 26 1 25 65

there are missing the columns when there are not products cancelled for Pd2 and Pd3, the net columns (pdAct-PdCanc), sub total and totals..

Thanks in advance for all the help...

mary


#2

Please post your sample data as create table statement(s) and insert statements so we know what you are working with.


#3

Thanks for taking time to reply and help. It is appreciated! :slight_smile:

Here is the code to create the tables. is it possible to send a txt file with the insertion code?

Create Table Contract_Header
(
iId int,
iDealerId int,
sContractNumber varchar(20),
sContractStatusCode varchar(1),
sContractStatusDesc nvarchar(20),
dBillDate date,
dtContractCancelledBilled date,
sProductCode varchar(4)
)

Create Table Dealer_Header
(
iId int
)

Create Table Dealer_DealerGroups
(
iId int,
sDealerGroupNumber varchar(20)
)

Create Table Dealer_DealerGroupLink
(iDealerId int,
iDealerGroupId int
)

Thanks again for all your help :slight_smile:

mary


#4

try this right here.

Create Table #Dealer_Header
(
iId	int
)

insert into #Dealer_Header
select 1 as iId	 union
select 2 as iId	 union
select 3 as iId	 

then do something similar for the other tables. otherwise we have to the above for you still even if you send it as txt or csv or an embedded image.


#5

Insert into Dealer_Header (iId) VALUES('19767')
Insert into Dealer_Header (iId) VALUES('19768')
Insert into Dealer_Header (iId) VALUES('19769')
Insert into Dealer_Header (iId) VALUES('19770')
Insert into Dealer_Header (iId) VALUES('19772')
Insert into Dealer_Header (iId) VALUES('19773')
Insert into Dealer_Header (iId) VALUES('19774')
Insert into Dealer_Header (iId) VALUES('19593')
Insert into Dealer_Header (iId) VALUES('19594')
Insert into Dealer_Header (iId) VALUES('19595')
Insert into Dealer_Header (iId) VALUES('19600')
Insert into Dealer_Header (iId) VALUES('19603')
Insert into Dealer_Header (iId) VALUES('19604')
Insert into Dealer_Header (iId) VALUES('19605')
Insert into Dealer_Header (iId) VALUES('19606')
Insert into Dealer_Header (iId) VALUES('19607')
Insert into Dealer_Header (iId) VALUES('19611')
Insert into Dealer_Header (iId) VALUES('19612')
Insert into Dealer_Header (iId) VALUES('19615')
Insert into Dealer_Header (iId) VALUES('19616')
Insert into Dealer_Header (iId) VALUES('19617')
Insert into Dealer_Header (iId) VALUES('19618')
Insert into Dealer_Header (iId) VALUES('19622')
Insert into Dealer_Header (iId) VALUES('19624')
Insert into Dealer_Header (iId) VALUES('19625')
Insert into Dealer_Header (iId) VALUES('19626')
Insert into Dealer_Header (iId) VALUES('19627')
Insert into Dealer_Header (iId) VALUES('19628')
Insert into Dealer_Header (iId) VALUES('19629')
Insert into Dealer_Header (iId) VALUES('19630')
Insert into Dealer_Header (iId) VALUES('19631')
Insert into Dealer_Header (iId) VALUES('19632')
Insert into Dealer_Header (iId) VALUES('19633')
Insert into Dealer_Header (iId) VALUES('19634')
Insert into Dealer_Header (iId) VALUES('19636')
Insert into Dealer_Header (iId) VALUES('19639')
Insert into Dealer_Header (iId) VALUES('19643')
Insert into Dealer_Header (iId) VALUES('19644')
Insert into Dealer_Header (iId) VALUES('19646')
Insert into Dealer_Header (iId) VALUES('19647')
Insert into Dealer_Header (iId) VALUES('19648')
Insert into Dealer_Header (iId) VALUES('19649')
Insert into Dealer_Header (iId) VALUES('19650')
Insert into Dealer_Header (iId) VALUES('19651')
Insert into Dealer_Header (iId) VALUES('19652')
Insert into Dealer_Header (iId) VALUES('19654')
Insert into Dealer_Header (iId) VALUES('19655')
Insert into Dealer_Header (iId) VALUES('19656')
Insert into Dealer_Header (iId) VALUES('19659')
Insert into Dealer_Header (iId) VALUES('19661')
Insert into Dealer_Header (iId) VALUES('19663')
Insert into Dealer_Header (iId) VALUES('19664')
Insert into Dealer_Header (iId) VALUES('19667')
Insert into Dealer_Header (iId) VALUES('19668')
Insert into Dealer_Header (iId) VALUES('19670')
Insert into Dealer_Header (iId) VALUES('19671')
Insert into Dealer_Header (iId) VALUES('19672')
Insert into Dealer_Header (iId) VALUES('19673')
Insert into Dealer_Header (iId) VALUES('19674')
Insert into Dealer_Header (iId) VALUES('19675')
Insert into Dealer_Header (iId) VALUES('19676')
Insert into Dealer_Header (iId) VALUES('19677')
Insert into Dealer_Header (iId) VALUES('19678')
Insert into Dealer_Header (iId) VALUES('19679')
Insert into Dealer_Header (iId) VALUES('19680')
Insert into Dealer_Header (iId) VALUES('19681')
Insert into Dealer_Header (iId) VALUES('19682')
Insert into Dealer_Header (iId) VALUES('19685')
Insert into Dealer_Header (iId) VALUES('19686')
Insert into Dealer_Header (iId) VALUES('19688')
Insert into Dealer_Header (iId) VALUES('19691')
Insert into Dealer_Header (iId) VALUES('19714')
Insert into Dealer_Header (iId) VALUES('19715')
Insert into Dealer_Header (iId) VALUES('19716')
Insert into Dealer_Header (iId) VALUES('19717')
Insert into Dealer_Header (iId) VALUES('19718')
Insert into Dealer_Header (iId) VALUES('19719')
Insert into Dealer_Header (iId) VALUES('19801')
Insert into Dealer_Header (iId) VALUES('19848')
Insert into Dealer_Header (iId) VALUES('19853')
Insert into Dealer_Header (iId) VALUES('19882')
Insert into Dealer_Header (iId) VALUES('19883')
Insert into Dealer_Header (iId) VALUES('20010')
Insert into Dealer_Header (iId) VALUES('20011')
Insert into Dealer_Header (iId) VALUES('20012')


#6

Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19768','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19769','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19770','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19772','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19773','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19774','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19593','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19594','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19595','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19600','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19603','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19604','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19605','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19606','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19607','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19611','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19612','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19615','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19616','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19617','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19618','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19622','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19624','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19625','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19626','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19627','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19628','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19629','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19630','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19631','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19632','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19633','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19634','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19636','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19639','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19643','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19644','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19646','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19647','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19648','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19649','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19650','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19651','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19652','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19654','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19655','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19656','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19659','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19661','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19663','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19664','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19667','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19668','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19670','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19671','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19672','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19673','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19674','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19675','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19676','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19677','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19678','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19679','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19680','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19681','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19682','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19685','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19686','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19688','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19691','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19714','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19715','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19716','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19717','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19718','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19719','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19801','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19848','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19853','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19882','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19883','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('20010','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('20011','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('20012','539')


#7

Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6302224','19768','V0076808','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6302255','19768','V0076816','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6302322','19768','V0076833','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6302298','19768','V0076828','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6301944','19768','V0076732','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6301871','19768','V0076714','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6301438','19770','V0076601','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6300917','19773','V0076466','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6300924','19772','V0076469','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6300794','19773','V0076428','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6300889','19773','V0076459','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6301280','19770','V0076559','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6301119','19770','V0076518','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6301406','19770','V0076593','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6303264','19773','V0077068','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6302402','19768','V0076850','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6302429','19768','V0076857','A','Active','VSC','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6303779','19767','V0077185','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6303840','19773','V0077201','A','Active','VSC','20180430',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6303943','19772','V0077227','A','Active','VSC','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6303712','19773','V0077170','A','Active','VSC','20180430',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6343952','19770','V0087350','A','Active','VSC','20180430',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('5715591','19773','V0017638','C','Cancelled','VSC','20171025','20180416')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('5712031','19774','V0016815','C','Cancelled','VSC','20171023','20180410')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6276495','19768','V0070389','A','Active','VSC','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6275487','19770','V0070139','C','Cancelled','VSC','20180330','20180416')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6275053','19768','V0070040','A','Active','VSC','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6275299','19768','V0070088','A','Active','VSC','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6276653','19768','V0070425','A','Active','VSC','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6274947','19768','V0070012','A','Active','VSC','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('5704123','19773','TK716387','C','Cancelled','VSC','20160731','20180420')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('5704147','19773','TK717445','C','Cancelled','VSC','20160831','20180416')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6106614','19772','V0030627','C','Cancelled','VSC','20171208','20180423')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6197253','19769','V0051116','C','Cancelled','VSC','20180131','20180425')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6197346','19769','V0051138','C','Cancelled','VSC','20180131','20180416')


#8

Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6202700','20010','PA24024','C','Cancelled','AP','20180207','20180418')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6112105','19716','PA16085','C','Cancelled','AP','20171218','20180427')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6114668','19716','PA16281','C','Cancelled','AP','20171218','20180427')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6206445','19654','PA24361','C','Cancelled','AP','20180221','20180426')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6209535','19716','PA24598','C','Cancelled','AP','20180214','20180427')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293617','19652','PA32366','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293620','19668','PA32367','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293640','19671','PA32369','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293717','19883','PA32375','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293711','19622','PA32373','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293778','19668','PA32383','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293851','19717','PA32388','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293860','19647','PA32389','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293880','19618','PA32391','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293907','19715','PA32395','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293912','19594','PA32396','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293939','19668','PA32402','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293945','19607','PA32403','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6293996','19652','PA32410','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294002','19664','PA32411','A','Active','AP','20180410',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294014','19682','PA32412','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294028','19664','PA32413','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294029','19686','PA32414','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294043','19715','PA32416','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294050','19716','PA32417','A','Active','AP','20180409',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294093','20011','PA32421','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294134','19594','PA32424','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294116','19715','PA32423','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294186','19691','PA32426','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294205','19682','PA32430','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294218','19661','PA32431','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294240','20010','PA32433','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294263','19883','PA32435','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294303','19715','PA32438','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294314','19639','PA32440','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294310','19686','PA32439','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294325','19625','PA32442','A','Active','AP','20180428',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294349','19607','PA32443','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294374','19691','PA32446','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294404','20012','PA32448','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294414','19682','PA32450','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294472','20010','PA32456','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294517','19624','PA32458','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294551','19656','PA32463','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294558','19600','PA32464','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294565','19646','PA32465','A','Active','AP','20180430',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294583','19691','PA32468','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294589','19622','PA32469','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294623','19883','PA32470','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294638','19625','PA32474','A','Active','AP','20180428',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294664','19600','PA32477','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294719','19682','PA32483','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294734','19622','PA32487','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294744','20012','PA32488','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294763','19686','PA32490','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294781','19622','PA32491','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294784','19667','PA32492','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294786','19594','PA32493','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294792','19715','PA32494','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294793','19622','PA32495','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294853','19663','PA32499','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294856','19651','PA32501','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294863','19717','PA32502','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294879','19883','PA32504','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294908','20011','PA32507','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294910','19600','PA32508','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294906','19682','PA32506','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294969','19607','PA32511','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294976','19682','PA32512','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6294992','19607','PA32514','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295026','19682','PA32516','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295035','19682','PA32517','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295067','19691','PA32519','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295116','19686','PA32528','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295112','19882','PA32527','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295193','19686','PA32536','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295200','19615','PA32537','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295224','19668','PA32541','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295276','19622','PA32547','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295278','19644','PA32548','A','Active','AP','20180425',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295334','19688','PA32554','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295343','19883','PA32555','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295348','19624','PA32556','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295414','19691','PA32559','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295418','19618','PA32560','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295421','19686','PA32561','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295453','19624','PA32563','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295459','20011','PA32564','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295483','19682','PA32566','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295526','19625','PA32568','A','Active','AP','20180428',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295543','20011','PA32569','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295563','19717','PA32573','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295581','19715','PA32575','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295588','19681','PA32576','A','Active','AP','20180418',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295593','19622','PA32577','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295604','19882','PA32578','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295631','19801','PA32581','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295674','19717','PA32586','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295755','19682','PA32593','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295769','19654','PA32594','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295777','19801','PA32596','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295778','19668','PA32597','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295804','19686','PA32598','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295846','19717','PA32603','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295876','19882','PA32604','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295893','19607','PA32606','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295931','19668','PA32609','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295940','19661','PA32610','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295941','20012','PA32611','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295945','19686','PA32612','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295959','19801','PA32613','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6295991','19691','PA32615','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296001','19883','PA32617','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296008','19600','PA32618','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296010','19882','PA32619','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296015','19656','PA32620','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296066','19664','PA32626','A','Active','AP','20180410',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296084','19625','PA32627','A','Active','AP','20180428',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296114','19686','PA32630','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296169','19801','PA32634','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296178','19715','PA32636','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296185','19622','PA32638','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296209','19682','PA32639','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296304','19681','PA32643','A','Active','AP','20180418',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296377','20012','PA32649','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296379','19624','PA32650','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296428','19607','PA32653','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296458','20011','PA32658','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296486','19883','PA32663','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296497','19668','PA32664','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296529','20011','PA32666','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296562','19882','PA32668','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296621','19646','PA32673','A','Active','AP','20180430',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296634','19717','PA32675','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296683','19714','PA32680','A','Active','AP','20180410',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296726','19625','PA32682','A','Active','AP','20180428',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296728','19883','PA32683','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296731','19673','PA32684','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296735','20010','PA32685','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296750','19624','PA32686','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296810','19668','PA32690','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296825','19652','PA32692','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296831','19607','PA32693','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296856','19668','PA32695','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296870','19664','PA32697','A','Active','AP','20180404',NULL)


#9

Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296874','19668','PA32698','C','Cancelled','AP','20180403','20180410')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296877','19607','PA32699','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296896','19691','PA32700','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296919','19668','PA32701','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296932','19600','PA32702','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296934','19668','PA32703','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296945','19691','PA32704','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296962','20011','PA32705','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6296982','19624','PA32706','A','Active','AP','20180416',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297021','19691','PA32708','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297052','20011','PA32709','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297054','19624','PA32710','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297073','19883','PA32712','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297085','19686','PA32713','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297095','19717','PA32714','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297118','19648','PA32717','A','Active','AP','20180426',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297256','19652','PA32729','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297277','19801','PA32730','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297314','19715','PA32731','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297338','19668','PA32732','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297344','19593','PA32733','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297361','19883','PA32734','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297381','19593','PA32735','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297386','19654','PA32736','A','Active','AP','20180419',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297401','19681','PA32737','A','Active','AP','20180418',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297412','19593','PA32740','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297432','19593','PA32742','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297494','19671','PA32745','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297496','19668','PA32746','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297526','19682','PA32750','A','Active','AP','20180414',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297688','19717','PA32759','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297694','19883','PA32761','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297728','19671','PA32764','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297730','19593','PA32765','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297731','19622','PA32766','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297761','20012','PA32768','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297772','19593','PA32770','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297775','19671','PA32771','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297778','19715','PA32772','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297803','19664','PA32775','A','Active','AP','20180410',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297847','19691','PA32781','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6297971','19714','PA32789','A','Active','AP','20180410',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298006','19593','PA32791','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298013','19883','PA32793','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298048','19624','PA32796','A','Active','AP','20180405',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298067','19682','PA32798','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298141','19681','PA32801','A','Active','AP','20180418',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298156','19593','PA32804','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298167','19661','PA32805','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298191','19593','PA32808','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298213','19688','PA32809','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298215','19668','PA32811','A','Active','AP','20180416',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298239','19691','PA32813','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298244','19883','PA32814','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298260','19607','PA32816','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298322','19801','PA32822','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298327','19594','PA32823','A','Active','AP','20180430',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298393','19631','PA32831','A','Active','AP','20180424',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298412','19594','PA32832','A','Active','AP','20180430',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298419','19691','PA32834','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298426','19632','PA32835','A','Active','AP','20180405',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298464','20010','PA32837','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298469','20011','PA32838','C','Cancelled','AP','20180412','20180426')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298494','19675','PA32840','A','Active','AP','20180409',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298507','19607','PA32844','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298541','19691','PA32845','A','Active','AP','20180412',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298577','19671','PA32848','A','Active','AP','20180407',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298597','19625','PA32851','A','Active','AP','20180428',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298640','19593','PA32857','A','Active','AP','20180420',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298695','19625','PA32862','A','Active','AP','20180428',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298722','20010','PA32864','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298733','19661','PA32865','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298764','19664','PA32867','A','Active','AP','20180410',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298778','19715','PA32868','A','Active','AP','20180425',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298796','19622','PA32869','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298824','19607','PA32870','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298827','19622','PA32871','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298836','20010','PA32872','A','Active','AP','20180411',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298838','19668','PA32873','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298875','19882','PA32877','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298970','19622','PA32887','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6298993','19622','PA32889','A','Active','AP','20180413',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6146491','19647','PA19125','C','Cancelled','AP','20180102','20180424')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6266144','19594','PA29693','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6266154','19668','PA29694','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6266719','19654','PA29736','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6266788','20011','PA29742','A','Active','AP','20180416',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6266790','19594','PA29744','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6266865','19667','PA29754','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6267010','19594','PA29768','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6267043','19654','PA29781','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6267101','19618','PA29797','A','Active','AP','20180403',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6267360','19594','PA29832','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6267624','19801','PA29861','A','Active','AP','20180416',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268059','19654','PA29901','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268152','19632','PA29909','C','Cancelled','AP','20180416','20180504')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268356','19654','PA29931','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268412','19654','PA29940','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268297','19627','PA29923','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268457','19682','PA29943','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268462','19600','PA29944','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268505','19654','PA29950','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6268535','19627','PA29953','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6269528','19679','PA30058','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6269658','19654','PA30075','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6269707','19691','PA30077','A','Active','AP','20180405',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6269798','20011','PA30089','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6269849','19654','PA30095','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6269913','19594','PA30105','A','Active','AP','20180402',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6269922','19636','PA30107','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6270648','19682','PA30170','A','Active','AP','20180417',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6270495','19654','PA30158','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6270816','19664','PA30178','A','Active','AP','20180404',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6271181','19691','PA30209','A','Active','AP','20180405',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6271061','19654','PA30199','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6271221','19883','PA30212','C','Cancelled','AP','20180321','20180404')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6271240','19654','PA30214','A','Active','AP','20180406',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6332614','20010','PA35731','A','Active','AP','20180427',NULL)
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,sProductCode,dBillDate,dtContractCancelledBilled) VALUES('6332668','20011','PA35736','A','Active','AP','20180430',NULL)


#10

:thinking: your table definition does not match the DML you provided.


#11

Thanks for your help!

Please, excuse me the mistake. I tested all the tables creations and insert statements before post them. May you tell me which table is giving you errors?

Thanks again,

Mary


#12

where is the data for Dealer_DealerGroups


#13

Insert into Dealer_DealerGroups (iId,sDealerGroupNumber) VALUES('593','DG10000174')
Insert into Dealer_DealerGroups (iId,sDealerGroupNumber) VALUES('539','D100')

Sorry, again... I forgot to add it.

Thanks again... :slight_smile:


#14

Hi yosiasz:

I found the error in the code. Here it is:

create table Contract_Header
(iId	int,
iDealerId	int,
sContractNumber	varchar(20),
sContractStatusCode	varchar(1),
sContractStatusDesc	varchar(20),
dBillDate	date,
dtContractCancelledBilled	date,
sProductCode	varchar(10))

create table ssisdb.dbo.Dealer_Header(
iId	int)

create table ssisdb.dbo.Dealer_DealerGroups
(iId	int,
sDealerGroupNumber	varchar(20))

create table ssisdb.dbo.Dealer_DealerGroupLink
(iDealerId	int,
iDealerGroupId	int)

Data to Insert:

Insert into Dealer_Header (iId) VALUES('19767')
Insert into Dealer_Header (iId) VALUES('19768')
Insert into Dealer_Header (iId) VALUES('19769')
Insert into Dealer_Header (iId) VALUES('19770')
Insert into Dealer_Header (iId) VALUES('19772')
Insert into Dealer_Header (iId) VALUES('19773')
Insert into Dealer_Header (iId) VALUES('19774')
Insert into Dealer_Header (iId) VALUES('19593')
Insert into Dealer_Header (iId) VALUES('19594')
Insert into Dealer_Header (iId) VALUES('19595')
Insert into Dealer_Header (iId) VALUES('19600')
Insert into Dealer_Header (iId) VALUES('19603')
Insert into Dealer_Header (iId) VALUES('19604')
Insert into Dealer_Header (iId) VALUES('19605')
Insert into Dealer_Header (iId) VALUES('19606')
Insert into Dealer_Header (iId) VALUES('19607')
Insert into Dealer_Header (iId) VALUES('19611')
Insert into Dealer_Header (iId) VALUES('19612')
Insert into Dealer_Header (iId) VALUES('19615')
Insert into Dealer_Header (iId) VALUES('19616')
Insert into Dealer_Header (iId) VALUES('19617')
Insert into Dealer_Header (iId) VALUES('19618')
Insert into Dealer_Header (iId) VALUES('19622')
Insert into Dealer_Header (iId) VALUES('19624')
Insert into Dealer_Header (iId) VALUES('19625')
Insert into Dealer_Header (iId) VALUES('19626')
Insert into Dealer_Header (iId) VALUES('19627')
Insert into Dealer_Header (iId) VALUES('19628')
Insert into Dealer_Header (iId) VALUES('19629')
Insert into Dealer_Header (iId) VALUES('19630')
Insert into Dealer_Header (iId) VALUES('19631')
Insert into Dealer_Header (iId) VALUES('19632')
Insert into Dealer_Header (iId) VALUES('19633')
Insert into Dealer_Header (iId) VALUES('19634')
Insert into Dealer_Header (iId) VALUES('19636')
Insert into Dealer_Header (iId) VALUES('19639')
Insert into Dealer_Header (iId) VALUES('19643')
Insert into Dealer_Header (iId) VALUES('19644')
Insert into Dealer_Header (iId) VALUES('19646')
Insert into Dealer_Header (iId) VALUES('19647')
Insert into Dealer_Header (iId) VALUES('19648')
Insert into Dealer_Header (iId) VALUES('19649')
Insert into Dealer_Header (iId) VALUES('19650')
Insert into Dealer_Header (iId) VALUES('19651')
Insert into Dealer_Header (iId) VALUES('19652')
Insert into Dealer_Header (iId) VALUES('19654')
Insert into Dealer_Header (iId) VALUES('19655')
Insert into Dealer_Header (iId) VALUES('19656')
Insert into Dealer_Header (iId) VALUES('19659')
Insert into Dealer_Header (iId) VALUES('19661')
Insert into Dealer_Header (iId) VALUES('19663')
Insert into Dealer_Header (iId) VALUES('19664')
Insert into Dealer_Header (iId) VALUES('19667')
Insert into Dealer_Header (iId) VALUES('19668')
Insert into Dealer_Header (iId) VALUES('19670')
Insert into Dealer_Header (iId) VALUES('19671')
Insert into Dealer_Header (iId) VALUES('19672')
Insert into Dealer_Header (iId) VALUES('19673')
Insert into Dealer_Header (iId) VALUES('19674')
Insert into Dealer_Header (iId) VALUES('19675')
Insert into Dealer_Header (iId) VALUES('19676')
Insert into Dealer_Header (iId) VALUES('19677')
Insert into Dealer_Header (iId) VALUES('19678')
Insert into Dealer_Header (iId) VALUES('19679')
Insert into Dealer_Header (iId) VALUES('19680')
Insert into Dealer_Header (iId) VALUES('19681')
Insert into Dealer_Header (iId) VALUES('19682')
Insert into Dealer_Header (iId) VALUES('19685')
Insert into Dealer_Header (iId) VALUES('19686')
Insert into Dealer_Header (iId) VALUES('19688')
Insert into Dealer_Header (iId) VALUES('19691')
Insert into Dealer_Header (iId) VALUES('19714')
Insert into Dealer_Header (iId) VALUES('19715')
Insert into Dealer_Header (iId) VALUES('19716')
Insert into Dealer_Header (iId) VALUES('19717')
Insert into Dealer_Header (iId) VALUES('19718')
Insert into Dealer_Header (iId) VALUES('19719')
Insert into Dealer_Header (iId) VALUES('19801')
Insert into Dealer_Header (iId) VALUES('19848')
Insert into Dealer_Header (iId) VALUES('19853')
Insert into Dealer_Header (iId) VALUES('19882')
Insert into Dealer_Header (iId) VALUES('19883')
Insert into Dealer_Header (iId) VALUES('20010')
Insert into Dealer_Header (iId) VALUES('20011')
Insert into Dealer_Header (iId) VALUES('20012')

Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19767','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19768','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19769','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19770','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19772','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19773','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19774','593')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19593','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19594','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19595','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19600','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19603','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19604','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19605','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19606','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19607','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19611','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19612','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19615','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19616','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19617','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19618','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19622','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19624','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19625','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19626','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19627','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19628','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19629','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19630','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19631','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19632','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19633','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19634','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19636','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19639','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19643','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19644','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19646','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19647','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19648','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19649','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19650','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19651','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19652','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19654','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19655','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19656','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19659','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19661','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19663','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19664','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19667','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19668','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19670','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19671','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19672','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19673','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19674','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19675','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19676','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19677','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19678','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19679','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19680','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19681','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19682','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19685','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19686','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19688','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19691','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19714','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19715','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19716','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19717','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19718','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19719','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19801','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19848','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19853','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19882','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('19883','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('20010','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('20011','539')
Insert into Dealer_DealerGroupLink (iDealerId,iDealerGroupId) VALUES('20012','539')

Insert into Dealer_DealerGroups (iId,sDealerGroupNumber) VALUES('593','DG10000174')
Insert into Dealer_DealerGroups (iId,sDealerGroupNumber) VALUES('539','D100')

Thanks again for your help! It is appreciated...

M


#15

This is for contract_header:

Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6112105','19716','PA16085','C','Cancelled',CONVERT(date, '20171218', 121),CONVERT(date, '20180427', 121),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6114668','19716','PA16281','C','Cancelled',CONVERT(date, '20171218', 121),CONVERT(date, '20180427', 121),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6202700','20010','PA24024','C','Cancelled',CONVERT(date, '20180207', 121),CONVERT(date, '20180418', 121),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6206445','19654','PA24361','C','Cancelled',CONVERT(date, '20180221', 121),CONVERT(date, '20180426', 121),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6209535','19716','PA24598','C','Cancelled',CONVERT(date, '20180214', 121),CONVERT(date, '20180427', 121),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293617','19652','PA32366','A','Active',CONVERT(date, '20180417', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293620','19668','PA32367','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293640','19671','PA32369','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293717','19883','PA32375','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293711','19622','PA32373','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293778','19668','PA32383','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293851','19717','PA32388','A','Active',CONVERT(date, '20180406', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293860','19647','PA32389','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293880','19618','PA32391','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293907','19715','PA32395','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293912','19594','PA32396','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293939','19668','PA32402','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293945','19607','PA32403','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6293996','19652','PA32410','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294002','19664','PA32411','A','Active',CONVERT(date, '20180410', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294014','19682','PA32412','A','Active',CONVERT(date, '20180420', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294028','19664','PA32413','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294029','19686','PA32414','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294043','19715','PA32416','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294050','19716','PA32417','A','Active',CONVERT(date, '20180409', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294093','20011','PA32421','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294134','19594','PA32424','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294116','19715','PA32423','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294186','19691','PA32426','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294205','19682','PA32430','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294218','19661','PA32431','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294240','20010','PA32433','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294263','19883','PA32435','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294303','19715','PA32438','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294314','19639','PA32440','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294310','19686','PA32439','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294325','19625','PA32442','A','Active',CONVERT(date, '20180428', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294349','19607','PA32443','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294374','19691','PA32446','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294404','20012','PA32448','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294414','19682','PA32450','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294472','20010','PA32456','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294517','19624','PA32458','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294551','19656','PA32463','A','Active',CONVERT(date, '20180417', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294558','19600','PA32464','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294565','19646','PA32465','A','Active',CONVERT(date, '20180430', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294583','19691','PA32468','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294589','19622','PA32469','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294623','19883','PA32470','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294638','19625','PA32474','A','Active',CONVERT(date, '20180428', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294664','19600','PA32477','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294719','19682','PA32483','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294734','19622','PA32487','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294744','20012','PA32488','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294763','19686','PA32490','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294781','19622','PA32491','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294784','19667','PA32492','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294786','19594','PA32493','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294792','19715','PA32494','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294793','19622','PA32495','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294853','19663','PA32499','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294856','19651','PA32501','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294863','19717','PA32502','A','Active',CONVERT(date, '20180406', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294879','19883','PA32504','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294908','20011','PA32507','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294910','19600','PA32508','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294906','19682','PA32506','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294969','19607','PA32511','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294976','19682','PA32512','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6294992','19607','PA32514','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295026','19682','PA32516','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295035','19682','PA32517','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295067','19691','PA32519','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295116','19686','PA32528','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295112','19882','PA32527','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295193','19686','PA32536','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295200','19615','PA32537','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295224','19668','PA32541','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295276','19622','PA32547','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295278','19644','PA32548','A','Active',CONVERT(date, '20180425', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295334','19688','PA32554','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295343','19883','PA32555','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295348','19624','PA32556','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295414','19691','PA32559','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295418','19618','PA32560','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295421','19686','PA32561','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295453','19624','PA32563','A','Active',CONVERT(date, '20180402', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295459','20011','PA32564','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295483','19682','PA32566','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295526','19625','PA32568','A','Active',CONVERT(date, '20180428', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295543','20011','PA32569','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295563','19717','PA32573','A','Active',CONVERT(date, '20180406', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295581','19715','PA32575','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295588','19681','PA32576','A','Active',CONVERT(date, '20180418', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295593','19622','PA32577','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295604','19882','PA32578','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295631','19801','PA32581','A','Active',CONVERT(date, '20180417', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295674','19717','PA32586','A','Active',CONVERT(date, '20180406', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295755','19682','PA32593','A','Active',CONVERT(date, '20180414', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295769','19654','PA32594','A','Active',CONVERT(date, '20180406', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295777','19801','PA32596','A','Active',CONVERT(date, '20180417', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295778','19668','PA32597','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295804','19686','PA32598','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295846','19717','PA32603','A','Active',CONVERT(date, '20180406', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295876','19882','PA32604','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295893','19607','PA32606','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295931','19668','PA32609','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295940','19661','PA32610','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295941','20012','PA32611','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295945','19686','PA32612','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295959','19801','PA32613','A','Active',CONVERT(date, '20180417', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6295991','19691','PA32615','A','Active',CONVERT(date, '20180412', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296001','19883','PA32617','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296008','19600','PA32618','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296010','19882','PA32619','A','Active',CONVERT(date, '20180403', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296015','19656','PA32620','A','Active',CONVERT(date, '20180417', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296066','19664','PA32626','A','Active',CONVERT(date, '20180410', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296084','19625','PA32627','A','Active',CONVERT(date, '20180428', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296114','19686','PA32630','A','Active',CONVERT(date, '20180411', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296169','19801','PA32634','A','Active',CONVERT(date, '20180417', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296178','19715','PA32636','A','Active',CONVERT(date, '20180404', 121), Cast(null as varchar),'AP')
Insert into Contract_Header(iId,iDealerId,sContractNumber,sContractStatusCode,sContractStatusDesc,dBillDate,dtContractCancelledBilled,sProductCode) VALUES('6296185','19622','PA32638','A','Active',CONVERT(date, '20180413', 121), Cast(null as varchar),'AP')

Thanks again,

M