Click here to Skip to main content
12,396,951 members (38,854 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: SQL-Server trigger
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 27-Jun-12 1:32am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Make @COLUMN3 parameter in Table B storedprocedure as optional parameter.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 27 Jun 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100