1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
|
CREATE TABLE #returndata
(appl_report_id varchar(32) NOT NULL
,rpt_id INT NOT NULL
, job_id INT NOT NULL
, job_mne_cd varchar (60) NOT NULL
, job_nm varchar(60) NOT NULL
, rpt_typ_id INT NOT NULL
, rpt_typ_nm varchar(50) NOT NULL
, rpt_nm varchar (60) NOT NULL
, person_id INT
, legal_entity_id INT
, recipient varchar(60) NOT NULL
, company_nm varchar(100) NOT NULL
, email_address varchar(60) NOT NULL
, phone_nm varchar(35) NOT NULL
, fax_nm varchar(35) NOT NULL
, address_id INT
, company_address varchar(250) NOT NULL
, delivery_mthd_cd varchar(1) NOT NULL
, delivery_mthd varchar(25) NOT NULL )
INSERT #returndata
SELECT appl_report_id --appl_report_id varchar(8) NOT NULL
,rpt_id --rpt_id INT NOT NULL
, job_id --job_id INT NOT NULL
, 'Unknown' --job_mne_cd varchar (60) NOT NULL
, 'Unknown' --job_nm varchar(60) NOT NULL
, rpt_typ_id--rpt_typ_id INT NOT NULL
, 'Tracking'-- varchar(50) NOT NULL
, rpt_nm --rpt_nm varchar (60) NOT NULL
, 0 --person_id INT
, 0 --legal_entity_id INT
, 'Unknown' --recipient varchar(60) NOT NULL
, 'Unknown' --company_nm varchar(60) NOT NULL
, 'Unknown' --email_address varchar(60) NOT NULL
, 'Unknown' --phone_nm varchar(35) NOT NULL
, 'Unknown' --fax_nm varchard(35) NOT NULL
, 0 --address_id INT
, 'Unknown' --company_address varchar(100) NOT NULL
, 'A' --delivery_mthd_cd varchar(1) NOT NULL
, 'Unknown' --delivery_mthd varchar(25) NOT NULL
FROM crs_db.dbo.t_rpt
WHERE rpt_typ_id = 102 AND
appl_report_id IN('510577','608970','622419','619860','567908','536382','553742', '536051','640364','582691','576990','578293','540046','610985','666229','613857','588615','577139','629519','537455','200155','200154','104606','107472','105874','200264','200415','200541','671124','200475')
|