Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

In the below query i have performed the commit transaction statement but still the values after the save are not saved.
Can you please let me know why are the statements after save are rolled back even after commiting the data. help me with the understanding

declare @trans2 varchar(10)='transaction2'
begin transaction @trans2
insert into emp values(100,'xy',600);
save transaction @trans2
insert into emp values(200,'pq',700);
insert into emp values(300,'pq',800);
commit transaction @trans2
rollback tran @trans2

Answer Posted / vijayalakshmi

declare @trans2 varchar(10)='transaction2' 
 begin transaction @trans2 
 insert into emp values(100,'xy',600); 
 save transaction @trans2 
 insert into emp values(200,'pq',700); 
 insert into emp values(300,'pq',800); 
 save transaction @trans2 
 commit transaction @trans2 
 rollback tran @trans2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of using third-party tools?

996


How to backup SQL Server Reporting Services ?

148


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

1004


You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?

1071


How to find index size for each index on table?

1003


Can a table be created inside a trigger?

967


What is partitioned view?

899


What will be the value of @@fetch_status if a row that was a part of the cursor resultset has been deleted from the database after the time the stored procedure that opened the cursor was executed?

1141


what is the difference between delete table and truncate table commands? : Sql server database administration

1033


What do you mean by sql server 2005 express management tools?

1305


Can a table be moved to different filegroup?

976


What are clustered and non-clustered index?

1008


How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?

1111


What are the different types of cursor?

1096


What is the difference between a clustered index and a non-clustered index?

991