Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jackal
Starting Member
2 Posts |
Posted - 2014-02-21 : 05:58:21
|
Hi my name is vishal. I was wondering how to create After insert trigger in sql server 2008. I have tablestable1:name:PurchaseOrder_masterColumn Name DataTypeagn(primary key not null) IntPO_NO varchar(50)supplier_id bigintPO_Date dateterms intTAX bigintrow_upd_date datetime user_id inttechnician_id biginttable2:name:PurchaseOrder_transColumn Name DataTypePO_id bigintPO_NO varchar(50)qty bigintprice floatstatus bitrow_upd_date datetimeuser_id inttable3:name:InwardColumn Name DataTypemfr_ref_number varchar(50) no_of_bundle intsupplier_id intDC_date dateINV_date daterow_upd_date datetimecourier_name varchar(50)inward_type varchar(50)user_id intdeleted_status bitdeleted_date datetimeDC_NO varchar(50)closed_status bitclosed_date datetimestore_no bigintto_dept varchar(50)agn(int primary key not null) IntPO_NO varchar(50)table4:name:Stock_RegisterColumn Name DataTypein_out_type inttechnician_id bigintuser_id introw_upd_date datetimestatus bitdeleted_date datetimedeleted_status bit item_id bigintqty_debit floatqty_credit floatint_out_id bigintstore_no bigintref_id bigintNow what i want is when i insert values in table Inward and after insertion of values in Inward table i want to insert values into tables(PurchaseOrder_master,PurchaseOrder_trans and Stock_Register) automatically using AfterInsert Trigger in Sql server 2008? Is it possible i can add common rows to each table if needed for the process. Can anyone tell me how to write AfterInsert Trigger for these tables ? Can anyone help me please.Any help or guidance in writing AfterInsert trigger would be greatly appreciated.vishal77 |
|
|
|
|