我用restore database aa from disk='E:\xiao\backup\pubs.bak'
with norecovery 
还原数据库时老是提示数据库正在被使用,而在企业管理器中没有问题,

解决方案 »

  1.   

    没明白,我是在SQL查询分析器中进行的,老是提示数据库正在被使用,而在企业管理器中没有问题,
      

  2.   

    是sqlserver 2000吧?!你还原时先执行下
    use master
      

  3.   

    是sqlserver2000,
    老大,你能不能说明白点,把sql语句写给我可以吗?
      

  4.   

    我早给你啦,你看不见?use master
      

  5.   

    use masterrestore database aa from disk='E:\xiao\backup\pubs.bak'
    with norecovery 
    就这样
      

  6.   

    运行后提示
     It is being used by database 'pubs'.
      

  7.   

    use master
    go
    restore database aa from disk='E:\xiao\backup\pubs.bak'
    with norecovery报什么错贴出来看看
      

  8.   

    这是运行,
    use master
    go
    restore database aa from disk='E:\xiao\backup\pubs.bak'
    with norecovery后的错误提示
    Server: Msg 1834, Level 16, State 1, Line 1
    The file 'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs.mdf' cannot be overwritten.  It is being used by database 'pubs'.
    Server: Msg 3156, Level 16, State 1, Line 1
    File 'pubs' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs.mdf'. Use WITH MOVE to identify a valid location for the file.
    Server: Msg 1834, Level 16, State 1, Line 1
    The file 'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_log.ldf' cannot be overwritten.  It is being used by database 'pubs'.
    Server: Msg 3156, Level 16, State 1, Line 1
    File 'pubs_log' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_log.ldf'. Use WITH MOVE to identify a valid location for the file.
    Server: Msg 3013, Level 16, State 1, Line 1
    RESTORE DATABASE is terminating abnormally.
      

  9.   

    我说你别还原sqlserver自带的pubs