Advertisement
yuvarajupadhyaya

call procedure inside another procedure

May 17th, 2022
2,793
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE PROCEDURE Sp_insert  
  2. (  
  3. @ID INT,  
  4. @TempName VARCHAR(MAX)
  5. )
  6. AS
  7. BEGIN  
  8. DECLARE @SampleTable TABLE(id INT, Name VARCHAR(MAX))  
  9. INSERT INTO @SampleTable(id,Name)VALUES(@ID,@TempName)  
  10. SELECT*FROM @SampleTable  
  11. END
  12.  
  13. Here IS my SECOND stored PROCEDURE.
  14.  
  15. CREATE PROCEDURE Sp_Call
  16. (
  17. @SID INT,
  18. @Name VARCHAR(MAX)
  19. )
  20. AS
  21. BEGIN
  22. EXEC Sp_insert @ID=@SID,@TempName=@Name
  23. END
  24. FROM t  
Advertisement
RAW Paste Data Copied
Advertisement