Click here to Skip to main content
13,595,773 members
Rate this:
 
Please Sign up or sign in to vote.
begin try
		begin tran 
		    update table1 set col1=@col1 where col1=@col1 
		    insert into table2 (col1,col2,DTS) values (@col1,@col2,GETDATE())		    
		commit tran
//I think we retunr Return 1 
end try
begin catch
		rollback tran
// return -1
end catch	
but it getting return 2
Posted 18-Aug-15 1:33am
Updated 18-Aug-15 1:47am
v2
Comments
‭011111100010‬ 18-Aug-15 8:30am
   
Return 2? Find out where it is doing that. Is it a record count or is something returning that number.

What exactly is your question?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

"Would you tell me if we are using transection and modifying more then three table then how we will know that transection committed successfully or not"

If your code gets to the commit tran then it was successful.

If you are asking about the mods doing something specific then you would need to run checks that would raise and error if the update does not do what you expect.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.180621.3 | Last Updated 18 Aug 2015
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100