Tuesday, March 6, 2012

2005: sp_helpdevice returns 0 results

On a new install of SQL Server2000, sp_helpdevice returns at least one result
(for master) and you can call
sp_helpdevice 'master'
to always get that row.
On SQL Server2005, sp_helpdevice on a new install returns no results, and
sp_helpdevice 'master' generates an error.
Anyone know how to find out the file path where the master database is stored?sp_helpdevice was used to return the name/location of backup devices, so it
seems an odd choice to use just to return the location of master.
Anyway, in SQL Server 2005, you want to use system catalog views. For
example, the following statement returns the physical location of the master
database files.
SELECT name, physical_name
FROM sys.master_files
WHERE database_id = DB_ID('master')
For additional information about catalog views, see the topic "Catalog Views
(Transact-SQL)" in Books Online.
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"michael pryor" <michael pryor@.discussions.microsoft.com> wrote in message
news:78862BE2-74CB-446E-B119-3B2518596A60@.microsoft.com...
> On a new install of SQL Server2000, sp_helpdevice returns at least one
> result
> (for master) and you can call
> sp_helpdevice 'master'
> to always get that row.
> On SQL Server2005, sp_helpdevice on a new install returns no results, and
> sp_helpdevice 'master' generates an error.
> Anyone know how to find out the file path where the master database is
> stored?|||Is there a problem with using sp_helpfile 'master' and looking at the
filename?

No comments:

Post a Comment