x

database size to 30 GB

Can we create the database with 30 GB OR MORE as per our wish?

can we add/modify the database size to 30 GB as already existing Database in server?

more ▼

asked Oct 15, 2012 at 01:59 PM in Default

askmlx121 gravatar image

askmlx121
2.5k 64 74 77

Remember, if you got the answer to your question, make sure you mark it by clicking on the check box next to it.
Oct 16, 2012 at 09:33 AM Grant Fritchey ♦♦
Not only can you... it's a Best Practice to pre-allocate the space.
Oct 16, 2012 at 12:43 PM Blackhawk-17
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Yes, when you create the database put the default size as 30720, this creates the database with size of 30 GB but they are unused reserved space that can will be used later when database grows with user objects, but make sure you have enabled "instant file initialization" for the SQL Server account to boost up the performance of creating database to 30 GB.

Use alter database modify file for altering existing db size.

ALTER DATABASE MyDB MODIFY FILE (NAME = MyFile, SIZE = 30720)

more ▼

answered Oct 15, 2012 at 02:05 PM

Cyborg gravatar image

Cyborg
10.6k 36 40 45

Also assuming you have the space ;-)
Oct 15, 2012 at 02:14 PM sp_lock
Great thanks
Oct 15, 2012 at 02:46 PM askmlx121
be sure to size the data file and not the log file...
Oct 15, 2012 at 06:58 PM Fatherjack ♦♦
(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:

x1945
x238

asked: Oct 15, 2012 at 01:59 PM

Seen: 1145 times

Last Updated: Oct 16, 2012 at 12:43 PM