Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
68 views2 pages

Misc New

The document contains SQL commands to modify the 'invtb_receiptdetail' table by adding a new column 'id_tamp_qty' and updating its values to zero. It also includes multiple insert statements for the 'opntb_pilot_group' table with specific values and dates. Additionally, it alters the 'audit_invtb_receiptdetail' table to add new columns and defines a trigger to log deletions and updates into an audit table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views2 pages

Misc New

The document contains SQL commands to modify the 'invtb_receiptdetail' table by adding a new column 'id_tamp_qty' and updating its values to zero. It also includes multiple insert statements for the 'opntb_pilot_group' table with specific values and dates. Additionally, it alters the 'audit_invtb_receiptdetail' table to add new columns and defines a trigger to log deletions and updates into an audit table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

alter table invtb_receiptdetail

add id_tamp_qty decimal(10,2) null

update invtb_receiptdetail set id_tamp_qty=0

insert into opntb_pilot_group


(pg_stf_code,pg_st_date,pg_end_date,pg_pilot_type,pg_sta_who,pg_sta_crt_date,pg_sta
tus)
values('S0665','2009-12-21 00:00:00.000','2010-01-01
00:00:00.000','TMP','S0574','2010-01-01 00:00:00.000','L')

insert into opntb_pilot_group


(pg_stf_code,pg_st_date,pg_end_date,pg_pilot_type,pg_sta_who,pg_sta_crt_date,pg_sta
tus)
values('S0636','2009-12-21 00:00:00.000','2010-01-01
00:00:00.000','TMP','S0574','2010-01-01 00:00:00.000','L')

insert into opntb_pilot_group


(pg_stf_code,pg_st_date,pg_end_date,pg_pilot_type,pg_sta_who,pg_sta_crt_date,pg_sta
tus)
values('S0200','2009-12-21 00:00:00.000','2010-01-01
00:00:00.000','TMP','S0574','2010-01-01 00:00:00.000','L')

insert into opntb_pilot_group


(pg_stf_code,pg_st_date,pg_end_date,pg_pilot_type,pg_sta_who,pg_sta_crt_date,pg_sta
tus)
values('S0651','2009-12-21 00:00:00.000','2010-01-01
00:00:00.000','TMP','S0574','2010-01-01 00:00:00.000','L')

alter table audit_invtb_receiptdetail


add id_hq_qty decimal(10,2) null,
add id_gul_qty decimal(10,2) null,
add id_tamp_qty decimal(10,2) null

ALTER TRIGGER [dbo].[trig_invtb_receiptdetail] ON [dbo].[invtb_receiptdetail]


FOR DELETE, UPDATE AS
BEGIN
insert into Orix_Audit_DB..audit_invtb_receiptdetail
select
id_grn_num,
id_stock_num,
id_org_grn,
id_itm_qty,
id_unit_price,
id_rem_ark,
id_sta_ind,
id_sta_who,
id_sta_dat,
id_stock_trans,
id_stock_type,
system_user, getdate(),
id_hq_qty,
id_gul_qty,
id_tamp_qty from deleted
END

You might also like