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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Inserting a data into another table

Author  Topic 

prakashuj
Starting Member

12 Posts

Posted - 2007-10-15 : 07:29:44
Dear All,
i have two tables OE,GI
OE constist of FormId,FormCode,Sender,Creator,Stateid,Name,Client,

GI Constist of FormCode,Sender,Creator,stateId ,

I have to insert or update a record into GI table as i insert or Update record in OE table,
Now i am using trigger concept for it.

Is there any other way to insert or update the record in GI other rather trigger


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-10-15 : 07:38:58
yes. Do it in your stored procedure. Have a stored procedure that insert into both tables.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2007-10-16 : 11:20:59
If they are reliant on each other , wrap it in a transaction and consider using SCOPE_IDENTITY() to manage your IDs

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -