Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trigger to cascade new entry to second table

Status
Not open for further replies.

philrm

MIS
Joined
Jun 1, 1999
Messages
58
Location
AU
I need cascade entry of a number field (long int) from one table to another. The first table holds the primary key which is the number that needs to cascade to a second table. The second table is also using the number a primary key (not sure this is ok). Should I use a trigger on insert to do this or should the trigger execute a stored procedure?
What would be the correct syntax for the sql statment to make this type of thing work?
Can anybody point me to some good info on triggers and how and when to use them.
 
create trigger InsTrigger
on MyTable
For Insert as
insert into MyTable2
select MyNumField from inserted

Robert Bradley

 
I actually found the books on line provided enough examples for me to figure out how to write the one simple trigger I needed to create.

I would give the books on line a try.
Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top