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...


After using delete statement in sql query to delete some
records...to retrieve the deleted records we can get using
rollback command but till that where it stores means
particular location name i need....(after deleting and
rollback )

Answers were Sorted based on User's Feedback



After using delete statement in sql query to delete some records...to retrieve the deleted records..

Answer / nagesh

wen we are performing DML operations into table . 2 magic
tables created in the memory i.e., in Master Database.
Names of the 2 tables
1) INSERTED
2) DELETED

When we insert any record then that record will be added
into this Inserted table initially, similarly while
updating a record a new entry will be inserted into
Inserted table & old value will be inserted into Deleted
table.

In the case of deletion of a record then it will insert
that record in the Deleted table

when we call rollback command the deleted record retrieved
from Deleted table. Once committed we can't call rollback.

Is This Answer Correct ?    18 Yes 5 No

After using delete statement in sql query to delete some records...to retrieve the deleted records..

Answer / saravanan p

When we delete the records using triggers only the deleted
records will be stored in deleted table.

But if we do delete using begin transaction, the deleted
records will be stored in transaction log file. We cannot
see it visually.

Is This Answer Correct ?    5 Yes 1 No

After using delete statement in sql query to delete some records...to retrieve the deleted records..

Answer / imran

SQL Server keeps log for each deleted records. you can
query these logs via 'fn_dblog' sql server function.

Select [RowLog Contents 0] FROM sys.fn_dblog(NULL, NULL)
WHERE AllocUnitName = 'dbo.TableName' AND Context IN
( 'LCX_MARK_AS_GHOST', 'LCX_HEAP' ) AND Operation in
( 'LOP_DELETE_ROWS' )

But this log is in Hex format. and you need to convert this
Hex format to your actual data.

Given below is the article that can help you to recover the
deleted records in the same way defined above.

http://raresql.com/2011/10/22/how-to-recover-deleted-data-
from-sql-sever/

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More SQL Server Interview Questions

Explain index in sql server?

0 Answers  


What is a non equi join?

0 Answers  


why we use cursor?

4 Answers   CarrizalSoft Technologies, Melstar, TCS,


WHAT IS THE DIFFERENCE BETWEEN CANDIDATE KEY ,COMPOSITE KEY AND PRIMARY KEY. THAN U.

1 Answers   Synergy,


While you are inserting values into a table with the insert into .. Values option, does the order of the columns in the insert statement have to be the same as the order of the columns in the table?

0 Answers  


What is the library index called?

0 Answers  


Hi, I have a table A which has four rows as follows Table A ------- empname salary ------- ------ A 1000 B 2000 C 3000 A 1000 B 2000 D 5000 I need the following output: empname salary ------- ------ A 1000 A 1000 B 2000 B 2000 Thanks in advance

10 Answers   IBM,


Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

0 Answers  


Do you know what are the properties of the relational tables?

0 Answers  


What is table level trigger?

0 Answers  


Explain Active/Active and Active/Passive cluster configurations

2 Answers  


What are the new data types are introduced in sql 2000?

0 Answers  


Categories