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
Showing posts with label Transaction In sql server(Maintaining Relationship). Show all posts
Showing posts with label Transaction In sql server(Maintaining Relationship). Show all posts
Sunday, October 31, 2010
Subscribe to:
Posts (Atom)