x

number of MDF files for a database

in sql 2000 we can attach upto 16 Mdf files using sp_attach_db, from 2005 onwards we use For Attach clause. my question here is, how many MDF files can be created for a particular database.

more ▼

asked Nov 11, 2009 at 08:50 AM in Default

tambiraj gravatar image

tambiraj
11 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Microsoft recommend one data file per filegroup per CPU core.

http://technet.microsoft.com/en-gb/library/cc966414.aspx

In 2005 I'm not aware of any limit on the number of files that can be attached using the FOR ATTACH clause. I have successfully attached more than 20 files of a single database.

more ▼

answered Nov 11, 2009 at 10:36 AM

David 1 gravatar image

David 1
1.8k 1 3

You're right David, I was looking at the old sp_attach_db. I'm getting old...
Nov 11, 2009 at 10:50 AM Mark Allison
(comments are locked)
10|1200 characters needed characters left

You can create up to 32,767 files in a database. However you can only attach 16 files.

more ▼

answered Nov 11, 2009 at 09:29 AM

Mark Allison gravatar image

Mark Allison
479 1 1 4

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x238

asked: Nov 11, 2009 at 08:50 AM

Seen: 2093 times

Last Updated: Nov 11, 2009 at 08:50 AM