Table-level backup

前端 未结 16 1576
孤城傲影
孤城傲影 2020-12-02 06:37

How to take table-level backup (dump) in MS SQL Server 2005/2008?

16条回答
  •  遥遥无期
    2020-12-02 07:09

    I am using the bulk copy utility to achieve table-level backups

    to export:

    bcp.exe "select * from [MyDatabase].dbo.Customer " queryout "Customer.bcp" -N -S localhost -T -E
    

    to import:

    bcp.exe [MyDatabase].dbo.Customer in "Customer.bcp" -N -S localhost -T -E -b 10000
    

    as you can see, you can export based on any query, so you can even do incremental backups with this. Plus, it is scriptable as opposed to the other methods mentioned here that use SSMS.

提交回复
热议问题