Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to insert values in multiple tables using storedprocedure?
What is errorlog & How to use?
Posted

OP wrote:
How to insert values in multiple tables using storedprocedure?

Big deal?
SQL
CREATE PROCEDURE Usp_StudentDetails(@StudentID int, @StudentName Varchar(50), @Mark int)
AS
BEGIN
   INSERT INTO Tbl_Student(StudentID,StudentName) VALUES(@StudentID,@StudentName)
   INSERT INTO Tbl_Marks(StudentID,Mark) VALUES(@StudentID,@Mark)
END

BTW customize things based on your need. Also use Try Catch.
OP wrote:
What is errorlog & How to use?

Here you go
SQL Server Error Logs[^]
SQL Server 2005 Error Log Management[^]
 
Share this answer
 
write multiple update statements inside a stored proc
 
Share this answer
 

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