Click here to Skip to main content
Rate this: bad
good
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 2: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 at 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
0 OriginalGriff 381
1 Sergey Alexandrovich Kryukov 245
2 Marcin Kozub 225
3 Praneet Nadkar 217
4 /\jmot 189
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,614
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 27 Jun 2012
Copyright © CodeProject, 1999-2014
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