I'm restoring a Bak file
RESTORE DATABASE WEbERP2 FROM DISK = 'c:\r\WEbERP_backup_201105210100.bak'
WITH REPLACE , MOVE 'WEbERP' TO 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\WEbERP2.mdf',
MOVE 'WEbERP_log' TO 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\WEbERP2_log.ldf',REPLACE
Im restoring it AS WEbERP2 //2 !!!
and it works.
the Db is opened as a new Db named :WEbERP2
But the logical name is still : WebErp.
I know that the functionality is fine .
But still I'm having trouble to understand its usages.
I know I can change it by :
ALTER DATABASE xxx MODIFY FILE (NAME=N...
But I want to understand its usages , and when its important to change it.
The logical filename is a database-unique identifier to identify the database files in T-SQL statements. It isn't important as such, and there is no important reason to change it.
However, it does allow you to know which is the MDF and LDF file without looking at physical names, or knowing the internal ID of the files.
More importantly, when you add filegroups and files to seperate indexes, data or add partitioning then the ability to have "WebERP_Indexes" and other names becomes useful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With