你先在他哪里作一个备份文件,然后回来再用那个备份恢复不就行了

解决方案 »

  1.   

    看看系统存储过程:
    1. sp_attach_db
    Examples
    This example attaches two files from pubs to the current server.EXEC sp_attach_db @dbname = N'pubs', 
       @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf', 
       @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'
    2. sp_attach_single_file_db
    Examples
    This example detaches pubs and then attaches one file from pubs to the current server.EXEC sp_detach_db @dbname = 'pubs'
    EXEC sp_attach_single_file_db @dbname = 'pubs', 
       @physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'