manoghna Posted August 3, 2011 Report Posted August 3, 2011 try thisBegin work Use dbGoDelete from table where id=5end___________________then rollbackrollback work ;
Jambhalheart Posted August 3, 2011 Author Report Posted August 3, 2011 [quote author=Jeedeelu link=topic=219819.msg2708827#msg2708827 date=1312388428]begin transactiondelete from test where id=5rollback tran[/quote][img]http://i51.tinypic.com/2jbwmzt.gif[/img][quote author=Maddy_Rulez link=topic=219819.msg2708828#msg2708828 date=1312388447]here, ur using begin transaction but I want to rollback a statement without using begin transaction [/quote]
pulithoka Posted August 3, 2011 Report Posted August 3, 2011 Nenu ninna idhe cheppa avvatledhu ani evadu pattinchukoledhu s%H# s%H#
dkchinnari Posted August 3, 2011 Report Posted August 3, 2011 [quote author=Jeedeelu link=topic=219819.msg2708841#msg2708841 date=1312388610]chusukoledhu ba....... CITI_$D# CITI_$D# CITI_$D#[/quote] ^^" ^^" ^^" CITI_$D#
Ranga_The_Donga Posted August 3, 2011 Report Posted August 3, 2011 [quote author=Maddy_Rulez link=topic=219819.msg2708846#msg2708846 date=1312388668][img]http://i51.tinypic.com/2jbwmzt.gif[/img][/quote] +_([quote author=Jeedeelu link=topic=219819.msg2708836#msg2708836 date=1312388553]i think u cant rollback without begin transaction...and error kuda dhani gurinche chepthunattundhii...[/quote]
Jambhalheart Posted August 3, 2011 Author Report Posted August 3, 2011 [quote author=pulithoka link=topic=219819.msg2708847#msg2708847 date=1312388674]Nenu ninna idhe cheppa avvatledhu ani evadu pattinchukoledhu s%H# s%H#[/quote]adhe kadha, avvadam ledhu ante avthondi annaru aa thadu lo chala mandhi...[quote author=Jeedeelu link=topic=219819.msg2708836#msg2708836 date=1312388553]i think u cant rollback without begin transaction...and error kuda dhani gurinche chepthunattundhii...[/quote]ninna oka thadu avthundi ani chinna debate jarigindhi mama, I will post that link wait..
Ranga_The_Donga Posted August 3, 2011 Report Posted August 3, 2011 dont comment out ur delete statement.....delete statementrollbackokasari execute cheyyi.....
manoghna Posted August 3, 2011 Report Posted August 3, 2011 [quote author=Jeedeelu link=topic=219819.msg2708891#msg2708891 date=1312389237]dont comment out ur delete statement.....delete statementrollbackokasari execute cheyyi.....[/quote] @gr33d
Jambhalheart Posted August 3, 2011 Author Report Posted August 3, 2011 [quote author=Jeedeelu link=topic=219819.msg2708891#msg2708891 date=1312389237]dont comment out ur delete statement.....delete statementrollbackokasari execute cheyyi.....[/quote]appudu record delete ayyi,, same error vasthondi , mama like this..(1 row(s) affected)Msg 3903, Level 16, State 1, Line 5The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
Jambhalheart Posted August 3, 2011 Author Report Posted August 3, 2011 [quote author=Jeedeelu link=topic=219819.msg2708836#msg2708836 date=1312388553]i think u cant rollback without begin transaction...and error kuda dhani gurinche chepthunattundhii...[/quote]ninna oka thadu lo ela post vesaru mama... many said that we can rollback even thou if we not using begin transaction.... anduke nenu confuse ayya...[img]http://i51.tinypic.com/2jbwmzt.gif[/img][quote author=meghana9 link=topic=219378.msg2703207#msg2703207 date=1312304033]delete from Employee where id = '01';1 row deleted.______________________________________________select id, last_name from Employee where id = '01';no rows selected ,since we deleted the row where id = 01_________________________________ rollback;Rollback complete.this example is from google .[/quote][quote author=meghana9 link=topic=219378.msg2703270#msg2703270 date=1312304806]till we commit the transcation we can do rollback. once we commit we cant do anything that is the reason why we have backup data ..correct me if am wrong ...[/quote][quote author=meghana9 link=topic=219378.msg2703382#msg2703382 date=1312305853]row ane kadu... previous changes ni restore cheyatam... as we do UNDO ..\delete lo ithe row ani chepochu [/quote]
pulithoka Posted August 3, 2011 Report Posted August 3, 2011 Goto SSMS--->Tools---->OptionsSelect query execution --> sqlserver--> ansi Check the Set Implicit transaction checkbox. now execute the same statement it will rollback
Jambhalheart Posted August 3, 2011 Author Report Posted August 3, 2011 [quote author=pulithoka link=topic=219819.msg2708978#msg2708978 date=1312390316]Goto SSMS--->Tools---->OptionsSelect query execution --> sqlserver--> ansi Check the Set Implicit transaction checkbox. now execute the same statement it will rollback[/quote]ledhu , avvadam ledhu... i m getting same error like this..(1 row(s) affected)Msg 3903, Level 16, State 1, Line 5The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
pulithoka Posted August 3, 2011 Report Posted August 3, 2011 [quote author=Maddy_Rulez link=topic=219819.msg2708991#msg2708991 date=1312390561]ledhu , avvadam ledhu... i m getting same error like this..(1 row(s) affected)Msg 3903, Level 16, State 1, Line 5The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.[/quote]After doing that open a new query window and execute the statement. Let me know what happens
Jambhalheart Posted August 3, 2011 Author Report Posted August 3, 2011 [quote author=pulithoka link=topic=219819.msg2708996#msg2708996 date=1312390619]After doing that open a new query window and execute the statement. Let me know what happens[/quote][img]http://www.desigifs.com/sites/default/files/bemmi.whistle_0.gif[/img][img width=106 height=118]http://www.desigifs.com/sites/default/files/bemmi.whistle_0.gif[/img][img width=106 height=118]http://www.desigifs.com/sites/default/files/bemmi.whistle_0.gif[/img][img width=106 height=118]http://www.desigifs.com/sites/default/files/bemmi.whistle_0.gif[/img][img width=106 height=118]http://www.desigifs.com/sites/default/files/bemmi.whistle_0.gif[/img][img width=106 height=118]http://www.desigifs.com/sites/default/files/bemmi.whistle_0.gif[/img]super its working now........... thankyou CITI_$D# CITI_$D#kani edhi ela work ayyindho , enduku work ayyindho cheppava plsss
pulithoka Posted August 3, 2011 Report Posted August 3, 2011 Hope this helps When ON, SET IMPLICIT_TRANSACTIONS sets the connection into implicit transaction mode. When OFF, it returns the connection to autocommit transaction mode.When a connection is in implicit transaction mode and the connection is not currently in a transaction, executing any of the following statements starts a transaction:ALTER TABLE, FETCH, REVOKE, BEGIN TRANSACTION, GRANT, SELECT, CREATE, INSERT, TRUNCATE TABLE, DELETE, OPEN, UPDATE, DROPIf the connection is already in an open transaction, the statements do not start a new transaction.Transactions that are automatically opened as the result of this setting being ON must be explicitly committed or rolled back by the user at the end of the transaction. Otherwise, the transaction and all of the data changes it contains are rolled back when the user disconnects. After a transaction is committed, executing one of the statements above starts a new transaction.Implicit transaction mode remains in effect until the connection executes a SET IMPLICIT_TRANSACTIONS OFF statement, which returns the connection to autocommit mode. In autocommit mode, all individual statements are committed if they complete successfully.The SQL Server Native Client OLE DB Provider for SQL Server and the SQL Server Native Client ODBC driver automatically set IMPLICIT_TRANSACTIONS to OFF when connecting. SET IMPLICIT_TRANSACTIONS defaults to OFF for connections with the SQLClient managed provider, and for SOAP requests received through HTTP endpoints.When SET ANSI_DEFAULTS is ON, SET IMPLICIT_TRANSACTIONS is ON.The setting of SET IMPLICIT_TRANSACTIONS is set at execute or run time and not at parse time.Source:MSDN
Recommended Posts