Traditional Culture Encyclopedia - Traditional stories - How to change the name of sql server2000 restore data backups
How to change the name of sql server2000 restore data backups
FROM DISK = 'C:BankDB_FilesFull_BackupBankDBbackup.bak'
GO
RESTORE DATABASE [BankArchive]
FROM DISK = N'C:BankDB_FilesFull_BackupBankDBbackup.bak'
WITH FILE = 1,
MOVE N'BankDB' TO N'C. BankArchive_FilesBankArchive.mdf',
MOVE N'BankDB2' TO N'C:BankArchive_FilesBankArchive2.ndf',
MOVE N'BankDB3' TO N'C. BankArchive_FilesBankArchive3.ndf',
MOVE N'BankDB_Log' TO N'C:BankArchive_FilesBankArchive_Log.ldf',
NOUNLOAD, REPLACE.
MOVE N'BankDB' TO N'C:BankArchive_FilesBankArchive.mdf',
MOVE N'BankDB2' TO N'C:BankArchive_FilesBankArchive2.ndf',
MOVE N'BankDB3' TO N'C:BankArchive_FilesBankArchive3.ndf',
MOVE N'BankDB_Log' TO N'C:BankArchive_FilesBankArchive_Log.ldf',
NOUNLOAD, REPLACE, STATS = 10
GO
Only the following will work in Management Studio:
Restore:
1. Right click on databases, choose 'restore database'.
2. In the Restore Database window, write the name of your destination database (BankArcive), and then specify the location of backup sets to restore (database or device).
3. Go to Options and change the name and/or location of the physical files (.mdf, .ldf) and click 4. OK.
Rename of existing database:
EXEC sp_helpdb 'BankDB'
GO
ALTER DATABASE BankDB
MODIFY FILE
(NAME = BankDB, NEWNAME='BankArchive')
GO
The name and/or location of the physical files (.mdf, .ldf) and click 4. p>ALTER DATABASE BankDB
MODIFY FILE
(NAME = BankDB2, NEWNAME='BankArchive2')
GO
ALTER DATABASE BankDB
MODIFY FILE
(NAME = BankDB3, NEWNAME='BankArchive3')
GO
ALTER DATABASE BankDB
MODIFY FILE
(NAME = BankDB_Log, NEWNAME = 'BankArchive_Log')
GO
Detailed information reference:
/library/ms190447(v=sql.105).aspx
- Previous article:Famous essays on Dragon Boat Festival
- Next article:Middle school math teaching how to carry out learning situation analysis
- Related articles
- Essentials and requirements of wearing traditional clothes
- Can a stainless steel pot boil Chinese medicine?
- How to change the vacuum tire
- How to do the second type of e-commerce combined with small programs?
- How to test the comprehensive quality evaluation of teacher recruitment
- What do you think are the roles of teaching prose?
- How to take pictures of blind people's horoscope
- The influence of traditional marketing on the market
- E-commerce to help agriculture
- Is the integrated decorative wallboard a scam?