获取.bak包中最近的差异备份文件进行还原,sql语句如何写?

解决方案 »

  1.   

    restore database nothwind from disk='c:\n.bak' with norecovery,file=1
    restore database nothwind from disk='c:\n.bak' with recovery ,file=2
      

  2.   

    RECOVERY
    指示还原操作回滚任何未提交的事务。在恢复进程后即可随时使用数据库。
    NORECOVERY
    指示还原操作不回滚任何未提交的事务。
      

  3.   

    restore database nothwind from disk='c:\n.bak' with norecovery,file=1
    restore database nothwind from disk='c:\n.bak' with recovery ,file=2
    ???这样?前提是不知道bak包中file有几个,要在程序中判断