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)
 Trigger + store procedure parameter

Author  Topic 

nduggan23
Starting Member

42 Posts

Posted - 2007-04-26 : 07:15:45
Hi ppl,

First post so hope its in the right place. Run into a problem.

Have to design a db with its on transaction logging in place.
So have say two tables.

tblContact & tran_tblContact

Have a store procedure that inserts into tblContact. within this storeprocedure there is a userID parameter. This is not stored in the tblContact. I want to store it in the tran_tblContact table.

Is it possible that when the sp is called that the trigger can get the userID? How would i go about making the parameter available to the trigger?

N.

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2007-04-26 : 07:29:54
Hope the trigger is created on tblContact and tran_tblContact will be updated from the trigger..right?

better put in a temporary table and use it inside the trigger
Go to Top of Page

nduggan23
Starting Member

42 Posts

Posted - 2007-04-26 : 07:32:59
Cool didnt think of approaching it that way.

Ya the trigger is on tblContact.

So in my procedure create a tmp table, store the userid and drop it in the procedure? Or in the trigger?

N.
Go to Top of Page

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2007-04-26 : 07:40:35
in the trigger
Go to Top of Page

nduggan23
Starting Member

42 Posts

Posted - 2007-04-26 : 07:54:02
Cheers for the info.
Go to Top of Page
   

- Advertisement -