You must Sign In to post a response.
  • Category: SQL Server

    Have to recover updated data.

    Hi friends,

    1. I updated a table with some wrong data, here around 5000 data were updated. I updated it without giving commit. Is it possible to recover the previous data?

    2. And how can i copy data from one server to another server?

    Any idea?

    Thanks in Advance
  • #765673
    1. If you are using transaction you can easily revert back. It is depending on the isolation level which you are using
    If you want more details about the isolation level, please go through the following article.

    2. Are you asking about SQL Server
    You can take backup and restore
    You can use Import/Export function
    Just copy the .MDF and .LDF files and attach and create database

    By Nathan
    Direction is important than speed

  • #765675
    1. If you are not using transaction then it is pretty difficult to get the data back.
    2. to transfer data from one server to another see below steps
    - if you want to transfer whole database then you can copy MDF file to another server and attached there directly
    - if you want to copy only table with data then you can use script for that.
    you can use Backing up/Exporting database also.
    There are two ways to Back up/Export a SQL Server database using SQL Server Management Studio:
    1.Right click database ? Tasks ? Generate Scripts ? Choose DB ? Change "Script Data" option to true ? …
    2..Right click database ? Tasks ? Backup ? ...
    If we have a .sql file and it's not too big we can just open it with SQL Server MS and run it.
    If we have a .sql file but it's too big to be opened with SQL Server MS we have to use sqlcmd like this:
    >sqlcmd -i C:\panels_QA28July11.sql -o C:\PanelsImportResult.txt
    see below link for more detail

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765689

    Using SQL server profiler you can get the details of the query which you have fired.But cant rollback unless you have used transaction.

    Hope it helps!!

  • #765701
    Hi Murugesan,

    1) If you are using Transactions you can able to get back the data by using logs.

    2) If you want to copy one server data into another server then get the backup of first server and copy the same in your desired server.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #766519
    Ans for Updating Question,
    1. I'm also faced this issue. But i tried lot. I can't get the original data which is having before the Updation. If you have backup of the database means you just simply restore and get those data's from there. Other Wise you won't. And One More thing Here after, without begin transactions and commit/ rollback you never execute the Update query.
    Ans for Copying the Data from One Server to Another Server,
    2. You can the Linked server. If you add the Server into another Server it very easy to copying the data.
    Use the Following statement:
    Sp_AddlinkedServer "ServerName"


  • #766879
    The Original data will not get back if you don't use the transactions many programmers face this type of situations if you have back up the database then you can attach that database and use it,

Sign In to post your comments