Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-06-21 : 11:22:45
|
| mara writes "I did a mistake and delete many records that are important but the size of my table is not changed. how I can recover these data?" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-06-21 : 12:15:57
|
| If you have transaction log backups (or are in full recovery mode) then you can do a point in time restore.Otherwise think of it as a learning experience.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-06-21 : 13:39:19
|
In Query Analyser I'm in the habit of writing my "snippets" of SQL in the style of:BEGIN TRANSACTIONDELETE FROM MyTable WHERE SomeCondition.. or some other statement ...ROLLBACK-- COMMIT If I'm doing this on production I may even highlight&run the block including the ROLLBACK to see number of rows etc.When I'm happy I then highlight without the ROLLBACK, run that, check the number of rows etc. again, and then highlight and run the COMMIT (I always run that twice to make sure that I get the "No transaction" error message - just in case I've managed to trigger more than one BEGIN TRANSACTION whilst messing around.) And if it goes pear-shaped the ROLLBACK is still sitting there ready tohighlight and run quickly - without causing mayhem on a production server by taking some time to type it whilst sweating buckets!This is perhaps more relevant when I lift something from PROFILER that I want to test - I don't want any side effects (INSERT/UPDATE/DELETE) from running the SProc, and I probably will need to try re-running it several times (whilst I tinker with the data or SProc etc.)Kristen |
 |
|
|
|
|
|