Sunday, February 19, 2012

File Groups

Say you create a database with three files: an mdf that's
on drive d, an ndf that's on drive e and a log file
that's on drive f.
1. Can you create a table across that will exist in both
mdf and ndf, i.e. place it across both drives d and e?
2. Ditto for a non-clustered index?You NDF file can be part of the same filegroup as your MDF file. Any object
you create within a filegroup essentially gets placed into both files of the
filegroup.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"CLM" <anonymous@.discussions.microsoft.com> wrote in message
news:2d5e901c469bc$d191d4e0$a301280a@.phx.gbl...
Say you create a database with three files: an mdf that's
on drive d, an ndf that's on drive e and a log file
that's on drive f.
1. Can you create a table across that will exist in both
mdf and ndf, i.e. place it across both drives d and e?
2. Ditto for a non-clustered index?|||You can span files but not filegroups. Files live inside a filgroup
(logically anyway). So as long as both files are in the same file group
then yes this is possible. You just create the object and specify that
filegroup and sql server will take care of splitting the data across the 2
files. More information can be found in BooksOnLine.
--
Andrew J. Kelly SQL MVP
"CLM" <anonymous@.discussions.microsoft.com> wrote in message
news:2d5e901c469bc$d191d4e0$a301280a@.phx.gbl...
> Say you create a database with three files: an mdf that's
> on drive d, an ndf that's on drive e and a log file
> that's on drive f.
> 1. Can you create a table across that will exist in both
> mdf and ndf, i.e. place it across both drives d and e?
> 2. Ditto for a non-clustered index?|||If you could post me to a link that has the syntax for
this, I'd sure appreciate it. I can't find the syntax
for this and I've checked BOL and various texts. Any
help would be much appreciated. (I take it you're
talking about putting multiple files in a filegroup in
the create database statement and then placing the table
in the filegroup, right?)
>--Original Message--
>You can span files but not filegroups. Files live
inside a filgroup
>(logically anyway). So as long as both files are in the
same file group
>then yes this is possible. You just create the object
and specify that
>filegroup and sql server will take care of splitting the
data across the 2
>files. More information can be found in BooksOnLine.
>--
>Andrew J. Kelly SQL MVP
>
>"CLM" <anonymous@.discussions.microsoft.com> wrote in
message
>news:2d5e901c469bc$d191d4e0$a301280a@.phx.gbl...
>> Say you create a database with three files: an mdf
that's
>> on drive d, an ndf that's on drive e and a log file
>> that's on drive f.
>> 1. Can you create a table across that will exist in
both
>> mdf and ndf, i.e. place it across both drives d and e?
>> 2. Ditto for a non-clustered index?
>
>.
>|||You want to check out the following in the BOL:
ALTER DATABASE
CREATE TABLE
CREATE INDEX
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"CLM" <anonymous@.discussions.microsoft.com> wrote in message
news:2c3ae01c469ca$38612f60$a601280a@.phx.gbl...
If you could post me to a link that has the syntax for
this, I'd sure appreciate it. I can't find the syntax
for this and I've checked BOL and various texts. Any
help would be much appreciated. (I take it you're
talking about putting multiple files in a filegroup in
the create database statement and then placing the table
in the filegroup, right?)
>--Original Message--
>You can span files but not filegroups. Files live
inside a filgroup
>(logically anyway). So as long as both files are in the
same file group
>then yes this is possible. You just create the object
and specify that
>filegroup and sql server will take care of splitting the
data across the 2
>files. More information can be found in BooksOnLine.
>--
>Andrew J. Kelly SQL MVP
>
>"CLM" <anonymous@.discussions.microsoft.com> wrote in
message
>news:2d5e901c469bc$d191d4e0$a301280a@.phx.gbl...
>> Say you create a database with three files: an mdf
that's
>> on drive d, an ndf that's on drive e and a log file
>> that's on drive f.
>> 1. Can you create a table across that will exist in
both
>> mdf and ndf, i.e. place it across both drives d and e?
>> 2. Ditto for a non-clustered index?
>
>.
>|||If you lookup ALTER DATABASE in BooksOnLine the first two examples show how
to add files and filegroups. To place a table or index in a specific
filegroup you simply add the ON YourFileGroup option to CREATE TABLE.
--
Andrew J. Kelly SQL MVP
"CLM" <anonymous@.discussions.microsoft.com> wrote in message
news:2c3ae01c469ca$38612f60$a601280a@.phx.gbl...
> If you could post me to a link that has the syntax for
> this, I'd sure appreciate it. I can't find the syntax
> for this and I've checked BOL and various texts. Any
> help would be much appreciated. (I take it you're
> talking about putting multiple files in a filegroup in
> the create database statement and then placing the table
> in the filegroup, right?)
>
> >--Original Message--
> >You can span files but not filegroups. Files live
> inside a filgroup
> >(logically anyway). So as long as both files are in the
> same file group
> >then yes this is possible. You just create the object
> and specify that
> >filegroup and sql server will take care of splitting the
> data across the 2
> >files. More information can be found in BooksOnLine.
> >--
> >Andrew J. Kelly SQL MVP
> >
> >
> >"CLM" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:2d5e901c469bc$d191d4e0$a301280a@.phx.gbl...
> >> Say you create a database with three files: an mdf
> that's
> >> on drive d, an ndf that's on drive e and a log file
> >> that's on drive f.
> >>
> >> 1. Can you create a table across that will exist in
> both
> >> mdf and ndf, i.e. place it across both drives d and e?
> >> 2. Ditto for a non-clustered index?
> >
> >
> >.
> >

No comments:

Post a Comment