
Signature
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
> Do you mean list the logical file names of an existing database? In that
> case, try sp_helpdb:
>
> EXEC sp_helpdb 'MyDatabase'
That was it.
I just wanted to be able to find the Logical name so I could use that to
change the logical name to match the DB name when I use a different Backup
to restore the database.
It seems to be in the second set of data that comes back where I assume the
name = Logical name and the filename is the actual db files.
Thanks,
Tom
>>I know how to get the logical name of a database from the backups (RESTORE
>>FILELISTONLY), but how do I get it from the database itself?
>>
>> Thanks,
>>
>> Tom
Dan Guzman - 18 Nov 2008 12:31 GMT
> It seems to be in the second set of data that comes back where I assume
> the name = Logical name and the filename is the actual db files.
If you don't the other information, one method to list only the files is
sp_helpfile:
USE MyDatabase
EXEC sp_helpfile
You can also get this information with SELECT * FROM sys.database_files.

Signature
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
>> Do you mean list the logical file names of an existing database? In that
>> case, try sp_helpdb:
[quoted text clipped - 20 lines]
>>>
>>> Tom
tshad - 20 Nov 2008 00:23 GMT
>> It seems to be in the second set of data that comes back where I assume
>> the name = Logical name and the filename is the actual db files.
[quoted text clipped - 6 lines]
>
> You can also get this information with SELECT * FROM sys.database_files.
I'll look at those as well.
Thanks,
Tom
>>> Do you mean list the logical file names of an existing database? In
>>> that case, try sp_helpdb:
[quoted text clipped - 20 lines]
>>>>
>>>> Tom