SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Creating After Insert Trigger in sql server 2008
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jackal
Starting Member

India
2 Posts

Posted - 02/21/2014 :  05:58:21  Show Profile  Reply with Quote
Hi my name is vishal. I was wondering how to create After insert trigger in sql server 2008. I have tables
table1:name:PurchaseOrder_master

Column Name DataType
agn(primary key not null) Int
PO_NO varchar(50)
supplier_id bigint
PO_Date date
terms int
TAX bigint
row_upd_date datetime
user_id int
technician_id bigint

table2:name:PurchaseOrder_trans

Column Name DataType
PO_id bigint
PO_NO varchar(50)
qty bigint
price float
status bit
row_upd_date datetime
user_id int

table3:name:Inward

Column Name DataType
mfr_ref_number varchar(50)
no_of_bundle int
supplier_id int
DC_date date
INV_date date
row_upd_date datetime
courier_name varchar(50)
inward_type varchar(50)
user_id int
deleted_status bit
deleted_date datetime
DC_NO varchar(50)
closed_status bit
closed_date datetime
store_no bigint
to_dept varchar(50)
agn(int primary key not null) Int
PO_NO varchar(50)

table4:name:Stock_Register

Column Name DataType
in_out_type int
technician_id bigint
user_id int
row_upd_date datetime
status bit
deleted_date datetime
deleted_status bit
item_id bigint
qty_debit float
qty_credit float
int_out_id bigint
store_no bigint
ref_id bigint

Now 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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000