原来的还保留。

解决方案 »

  1.   

    数据库改名
    sp_renamedb '原数据库名','新数据库名'
      

  2.   

    backup database 库 to disk='x:\备份文件名'
    go
    restore database 库名
    from disk='x:\备份文件名'
    with replace,
         move '逻辑数据文件名' to 'x:\物理数据文件名',
         move '逻辑日志文件名' to 'x:\物理日志文件名'
    得到逻辑文件名, 使用下面的语句:
    resotre filelistonly from disk='x:\备份文件名'查看结果集中的 logicalname
      

  3.   

    不太明白楼主的意思
    是要将数据库改名,还是要将数据库生成一个新数据1.数据库改名可以利用系统存储过程来实现
    sp_renamedb '原数据库名','新数据库名'
    2.如果是要根据数据库生成一个新数据库,有几种方法来实现
      a.利用数据库的备份及强制还原来实现
        --备份数据库
        backup database 数据库名 to disk='x:\数据库备份文件名'
        go
        --对数据库备份文件进行强制还原
       restore database 新数据库名
           from disk='x:\数据库备份文件名'
           With Move '逻辑数据名' to 'x:\物理数据文件名',
                Move '逻辑日志名' to 'x:\物理日志文件名'  b.新建一个数据库,利用SQL的导入导出功能,将原数据库的内容导入到新数据库中,这种方法完全可以在[企业管理器]中操作,对于新手比较方便
      

  4.   

    非常简单:How to restore a database backup (Enterprise Manager) 
    Note  If you are restoring a database backup that does not have any backup set information listed in the backup history stored in the msdb database, such as a database backup created on another server, see How to restore a backup from a backupdevice.
    To restore a database backup Expand a server group, and then expand a server.
    Expand Databases, right-click the database, point to All Tasks, and then click Restore Database.
    In the Restore as database box, type or select the name of the database to restore, if different from the default. To restore the database with a new name, type the new name of the database.
    Click Database.
    In the First backup to restore list, click the backup set to restore.
    In the Restore list, click the database backup to restore.
    Optionally, click the Options tab and do the following: 
    In Restore as, type the new name or location for each database file comprising the database backup.  
    Note  Specifying a new name for the database determines automatically the new names for the database files restored from the database backup.
    Click Leave database operational. No additional transaction logs can be restored if no further transaction log or differential database backups are to be applied.
    Click Leave database nonoperational, but able to restore additional transaction logs if another transaction log or differential database backup is to be applied.