Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Sunday, October 31, 2010

Transaction In sql server(Maintaining Relationship)

Create procedure sp_InsertRelation(@Code varchar(50),@Name Varchar(100),@Organisation varchar(100))
as
begin set nocount On
begin transaction
begin try
insert into empMaster(Code,Name) values(@Code,@Name)
insert into empDetails(Code,Organisation) values(@Code,@Organisation)
Commit Tran
end try
begin catch
rollback tran
end catch
End

No comments:

Post a Comment