a question about triggers..

melegant

Well-known member
Joined
Feb 2, 2003
Messages
52
Location
NY
I am attempting to call some table inserts from a piece of code on a table where i am attempting to create the following trigger (which calls the first shown stored procedure)

stored procedure
create proc sp_InitProposal @sanum int as INSERT INTO priceinfo (sanum,jobnum,altnum) values (@sanum,1,1)

question is, how do i use a trigger to use a field from the table i am applying the trigger to?

trigger
create trigger t_InitProposal on proposal for insert as exec sp_InitProposal [dbo].[proposal].[sanum]


When trying to make the trigger, it wont take with the reference to the [dbo].[proposal].[sanum]

ive tried everywhich way to make this work..it works of course if i say sp_InitPropsal(2001) etc..
argh!:confused:
 
I answered my own question. What i want isnt possible i dont think..or at least i am going about it the wrong way.

I was going to delete my question but, i figured let me spare somone the same mistakes i made...

I can just called a string of stored procedures in my vb.code to do what i want above..SQL cant tell me (i dont think at least) what a field was in the last record inserted that causes that trigger to fire..

thanks though extreme.net..these are the best formus..
 
Back
Top