Monday, February 20, 2012

List all files and autogrowth option

Can I get a list of all files a database comprise of and whether the
autogrowth option for the file is turned on or off
Output should be
DbName FileName Autogrowth_on_off
ABC c:\abc.mdf on
ABC d:\abc1.ndf off
ABC d:\abc2.ndf on
ABC e:\abc_log.ldf onEXEC sp_helpfile
or
SELECT *
FROM master.dbo.sysaltfiles
--
David Portas
SQL Server MVP
--|||Hi,
Execute the below stored procedure.
sp_helpdb <DBNAME>
Thanks
Hari
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OUO3JoTZFHA.2996@.TK2MSFTNGP10.phx.gbl...
> Can I get a list of all files a database comprise of and whether the
> autogrowth option for the file is turned on or off
> Output should be
> DbName FileName Autogrowth_on_off
> ABC c:\abc.mdf on
> ABC d:\abc1.ndf off
> ABC d:\abc2.ndf on
> ABC e:\abc_log.ldf on
>
>|||Guys, none of those options tell me if autogrowth is on or off
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23MXBnFUZFHA.2884@.tk2msftngp13.phx.gbl...
> Hi,
> Execute the below stored procedure.
> sp_helpdb <DBNAME>
>
> Thanks
> Hari
> SQL Server MVP
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:OUO3JoTZFHA.2996@.TK2MSFTNGP10.phx.gbl...
> > Can I get a list of all files a database comprise of and whether the
> > autogrowth option for the file is turned on or off
> >
> > Output should be
> >
> > DbName FileName Autogrowth_on_off
> > ABC c:\abc.mdf on
> > ABC d:\abc1.ndf off
> > ABC d:\abc2.ndf on
> > ABC e:\abc_log.ldf on
> >
> >
> >
> >
>|||I believe the MAXSIZE columnin the sysaltfiles that David pointed you to
determines if Autogrow is on or not. Another function you might be
interested in for various pieces of information related to the db is
DATABASEPROPERTYEX.
--
Andrew J. Kelly SQL MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:ehW9vlYaFHA.3144@.TK2MSFTNGP14.phx.gbl...
> Guys, none of those options tell me if autogrowth is on or off
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23MXBnFUZFHA.2884@.tk2msftngp13.phx.gbl...
>> Hi,
>> Execute the below stored procedure.
>> sp_helpdb <DBNAME>
>>
>> Thanks
>> Hari
>> SQL Server MVP
>> "Hassan" <fatima_ja@.hotmail.com> wrote in message
>> news:OUO3JoTZFHA.2996@.TK2MSFTNGP10.phx.gbl...
>> > Can I get a list of all files a database comprise of and whether the
>> > autogrowth option for the file is turned on or off
>> >
>> > Output should be
>> >
>> > DbName FileName Autogrowth_on_off
>> > ABC c:\abc.mdf on
>> > ABC d:\abc1.ndf off
>> > ABC d:\abc2.ndf on
>> > ABC e:\abc_log.ldf on
>> >
>> >
>> >
>> >
>>
>|||its the growth column in sysaltfiles. A zero indicates no autogrowth. I
could not find any databasepropertyex property to find this out for me
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OcOOJMdaFHA.2884@.tk2msftngp13.phx.gbl...
> I believe the MAXSIZE columnin the sysaltfiles that David pointed you to
> determines if Autogrow is on or not. Another function you might be
> interested in for various pieces of information related to the db is
> DATABASEPROPERTYEX.
> --
> Andrew J. Kelly SQL MVP
>
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:ehW9vlYaFHA.3144@.TK2MSFTNGP14.phx.gbl...
> > Guys, none of those options tell me if autogrowth is on or off
> >
> >
> > "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> > news:%23MXBnFUZFHA.2884@.tk2msftngp13.phx.gbl...
> >> Hi,
> >>
> >> Execute the below stored procedure.
> >>
> >> sp_helpdb <DBNAME>
> >>
> >>
> >> Thanks
> >> Hari
> >> SQL Server MVP
> >>
> >> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> >> news:OUO3JoTZFHA.2996@.TK2MSFTNGP10.phx.gbl...
> >> > Can I get a list of all files a database comprise of and whether the
> >> > autogrowth option for the file is turned on or off
> >> >
> >> > Output should be
> >> >
> >> > DbName FileName Autogrowth_on_off
> >> > ABC c:\abc.mdf on
> >> > ABC d:\abc1.ndf off
> >> > ABC d:\abc2.ndf on
> >> > ABC e:\abc_log.ldf on
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >
> >
>|||The DatabaseEx properties was for future references.
--
Andrew J. Kelly SQL MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:eCkMZglaFHA.3132@.TK2MSFTNGP09.phx.gbl...
> its the growth column in sysaltfiles. A zero indicates no autogrowth. I
> could not find any databasepropertyex property to find this out for me
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:OcOOJMdaFHA.2884@.tk2msftngp13.phx.gbl...
>> I believe the MAXSIZE columnin the sysaltfiles that David pointed you to
>> determines if Autogrow is on or not. Another function you might be
>> interested in for various pieces of information related to the db is
>> DATABASEPROPERTYEX.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Hassan" <fatima_ja@.hotmail.com> wrote in message
>> news:ehW9vlYaFHA.3144@.TK2MSFTNGP14.phx.gbl...
>> > Guys, none of those options tell me if autogrowth is on or off
>> >
>> >
>> > "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>> > news:%23MXBnFUZFHA.2884@.tk2msftngp13.phx.gbl...
>> >> Hi,
>> >>
>> >> Execute the below stored procedure.
>> >>
>> >> sp_helpdb <DBNAME>
>> >>
>> >>
>> >> Thanks
>> >> Hari
>> >> SQL Server MVP
>> >>
>> >> "Hassan" <fatima_ja@.hotmail.com> wrote in message
>> >> news:OUO3JoTZFHA.2996@.TK2MSFTNGP10.phx.gbl...
>> >> > Can I get a list of all files a database comprise of and whether the
>> >> > autogrowth option for the file is turned on or off
>> >> >
>> >> > Output should be
>> >> >
>> >> > DbName FileName Autogrowth_on_off
>> >> > ABC c:\abc.mdf on
>> >> > ABC d:\abc1.ndf off
>> >> > ABC d:\abc2.ndf on
>> >> > ABC e:\abc_log.ldf on
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>

No comments:

Post a Comment