Re: How to get Databse physical file name in 2005?
- From: "Gail Erickson [MS]" <gaile@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 10:48:53 -0800
You can use the sys.master_files catalog view. For example,
SELECT physical_name
FROM sys.master_files
WHERE database_id = DB_ID('master')
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"Mike9900" <Mike9900@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:47CB0212-5C36-4BF9-9854-3F3099309FE5@xxxxxxxxxxxxxxxx
> In SQL 2000 I could write SELECT filename FROM sysdatabases WHERE
> name='MyDB'
> and got the physical file name with its path.
>
> But in 2005, I get empty string when I use the query in c#. But it works
> when I use it in the Management Studio.
> --
> Mike
.
- Next by Date: Best place for SMO questions?
- Next by thread: Best place for SMO questions?
- Index(es):
Relevant Pages
|