Sunday, February 19, 2012

how get data and log file names for each database

Using SS2000. I'm trying to list the data and log files for each database. I
found the data filename in sysdatabases but where is the log filename?
Thanks,
--
Dan D.Easy enough:
EXEC sp_Msforeachdb
'USE ?;
SELECT * FROM sysfiles;'
Keith
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:9E6DAB1D-1D6A-4D06-A01E-B27DF7045541@.microsoft.com...
> I was hoping for something that I could use and not have to go to each
database. But I can write a script to loop through all of the databases.[vbcol=seagreen]
> Thanks,
> --
> Dan D.
>
> "Keith Kratochvil" wrote:
>
database.[vbcol=seagreen]|||That works. Didn't know about that table. Thanks.
--
Dan D.
"Jasper Smith" wrote:

> How about select * from sysaltfiles
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:9E6DAB1D-1D6A-4D06-A01E-B27DF7045541@.microsoft.com...
> database. But I can write a script to loop through all of the databases.
> database.
>
>|||That's good. I've never used that sp before. Thanks.
--
Dan D.
"Keith Kratochvil" wrote:

> Easy enough:
>
> EXEC sp_Msforeachdb
> 'USE ?;
> SELECT * FROM sysfiles;'
> --
> Keith
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:9E6DAB1D-1D6A-4D06-A01E-B27DF7045541@.microsoft.com...
> database. But I can write a script to loop through all of the databases.
> database.
>|||Good suggestion! I forgot about that table. The beauty of this method: one
set of results.
Keith
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:eQNg$VpaEHA.3664@.TK2MSFTNGP12.phx.gbl...
> How about select * from sysaltfiles
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:9E6DAB1D-1D6A-4D06-A01E-B27DF7045541@.microsoft.com...
> database. But I can write a script to loop through all of the databases.
> database.
filename?[vbcol=seagreen]
>|||how about this?
SELECT * FROM sysfiles
Keith
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:033064C1-068D-4124-8105-0621EDA42B5C@.microsoft.com...
> Using SS2000. I'm trying to list the data and log files for each database.
I found the data filename in sysdatabases but where is the log filename?
> Thanks,
> --
> Dan D.|||I was hoping for something that I could use and not have to go to each datab
ase. But I can write a script to loop through all of the databases.
Thanks,
--
Dan D.
"Keith Kratochvil" wrote:

> how about this?
> SELECT * FROM sysfiles
> --
> Keith
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:033064C1-068D-4124-8105-0621EDA42B5C@.microsoft.com...
> I found the data filename in sysdatabases but where is the log filename?
>|||How about select * from sysaltfiles
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:9E6DAB1D-1D6A-4D06-A01E-B27DF7045541@.microsoft.com...
> I was hoping for something that I could use and not have to go to each
database. But I can write a script to loop through all of the databases.[vbcol=seagreen]
> Thanks,
> --
> Dan D.
>
> "Keith Kratochvil" wrote:
>
database.[vbcol=seagreen]

No comments:

Post a Comment