none
How to restore table data from a .bcp snapshot file? RRS feed

  • Question

  • I have a transactional replication. I accidentally deleted a bunch of records from a table and before I noticed, the same was done on the other server through replication. Now I am looking for ways to restore the data.

    I can see that the replication folder has a snapshot of the table in a *.bcp file. How can I manually retreive data from that file?


    Please remember to mark the replies as answers if they answered your question :)
    Tuesday, May 25, 2010 8:46 AM

Answers

  • use bcp, ie bcp "DatabaseName.dbo.TableName"in tablename.bcp -S ServerName -T -E -n -b 10000

    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941
    Tuesday, May 25, 2010 1:50 PM
    Moderator

All replies

  • use bcp, ie bcp "DatabaseName.dbo.TableName"in tablename.bcp -S ServerName -T -E -n -b 10000

    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941
    Tuesday, May 25, 2010 1:50 PM
    Moderator
  • Thanks, my first idea was to use BCP for that, but it did not work as some formats were wrong. Now, knowing that this is the way to go, I tracked the fields down byte-by-byte and managed to fix the error.

    Thanks a lot.


    Please remember to mark the replies as answers if they answered your question :)
    Tuesday, May 25, 2010 3:47 PM