Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
i have two tables*Project Table ---->Contian two columns ProID && Name*ProjectEmployee Table ------->assigned employee for this project ----->contain two columns FK_ProID && FK_EmpIDi want to make transaction when update project update the ProjectEmployee Tablethis information come from asp page and Employee come in the form of check listi used stored procedure to call transaction ok how can i make this transactionmohamed samir abdeen
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2008-08-02 : 12:17:53
do you mean this?
CREATE PROC YourProc@Employee varchar(50),@Name varchar(50)DECLARE @ProjID int,@EmpID intINSERT INTO Project (Name)VALUES (@Name)SELECT @ProjID=SCOPE_IDENTITYINSERT INTO Employee (Name)VALUES (@Employee)SELECT @EmpID=SCOPE_IDENTITYINSERT INTO ProjectEmployeeSELECT @ProjID,@EmpIDGO