A
Adrian
What is the difference between Database Name and Logical Name?
Thanks,
Adrian
Thanks,
Adrian
Adrian said:See text below for both.
Adrian.
Syntax
CREATE DATABASE database_name
[ ON
[ < filespec > [ ,...n ] ]
[ , < filegroup > [ ,...n ] ]
]
[ LOG ON { < filespec > [ ,...n ] } ]
[ COLLATE collation_name ]
[ FOR LOAD | FOR ATTACH ]
< filespec > ::=
[ PRIMARY ]
( [ NAME = logical_file_name , ]
FILENAME = 'os_file_name'
[ , SIZE = size ]
[ , MAXSIZE = { max_size | UNLIMITED } ]
[ , FILEGROWTH = growth_increment ] ) [ ,...n ]
< filegroup > ::=
FILEGROUP filegroup_name < filespec > [ ,...n ]
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/29ddac46-7a0f-4151-bd94-William (Bill) Vaughn said:The Logical_file_name is used when creating a database via attachment. See
BOL "CREATE DATABASE (Transact SQL).
William (Bill) Vaughn said:Ok, sorry for the confusion.
The "Logical Name" in this case is the filename header (before the .mdf
extension). Generally, the database name is the same as the logical name as
"MyDatabase" is stored in "MyDatabase.MDF" and "MyDatabase.LDF" (log file).
However, if you want to obfuscate the database name to protect or hide it,
you can set the logical name to another value. I do this sometimes when I
replace or upgrade databases.
In 99% of the cases you don't need to change the Logical Name--leave it to
match the Database Name.
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________