Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
CREATE TRIGGER MyTrigger ON TableA
AFTER INSERT

AS

DECLARE @COLUMN1 AS NVARCHAR
DECLARE @COLUMN2 AS NVARCHAR
DECLARE @COLUMN3 AS NVARCHAR

SELECT @COLUMN1=COLUMN1,@COLUMN2=COLUMN2 FROM INSERTED
EXEC STOREDPROCEDURE @COLUMN1,@COLUMN2,@COLUMN3=?

i have two tables named table A and Table B and for the insertion purpose i have two stored procedure for both table. and when Table A's stored procedure will executes successfully a trigger will fire to call Table B's Stored procedure But My Question is How to pass parameter to Table B's stored procedure? as in my case table A does not contain column3 but in Table B i need To insert data in Column3
Posted

1 solution

Make @COLUMN3 parameter in Table B storedprocedure as optional parameter.
 
Share this answer
 
Comments
jitz102002 27-Jun-12 8:21am    
its not optional passed value for @column3 from Table A' stored procedure but i m looking forward to get dat value from Table A stored procedure return value so i can pass it to table b stored procedure by trigger

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900