Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to resize Initial Size?

Author  Topic 

spider
Starting Member

3 Posts

Posted - 2008-02-12 : 07:15:20
Hi, I wish resize the allocated space of my DB.
It's 245GB, but the DB is 50GB.
I tryed this query:

use master
GO
ALTER DATABASE mydb
MODIFY FILE
(NAME = 'mydb_data',SIZE= 50000)
GO

but I receive an error:
Msg 5039, Level 16, State 1, Line 1
MODIFY FILE failed. Specified size is less than current size.

Can you help me?
Thanks

CShaw
Yak Posting Veteran

65 Posts

Posted - 2008-02-12 : 10:34:12
So you want to shrink the file? If that is the case I would run a DBCC Shrinkfile.

Chris Shaw
www.SQLonCall.com
Go to Top of Page

spider
Starting Member

3 Posts

Posted - 2008-02-12 : 10:50:52
No, I don't want shrink the file! I want to decrease allocation file (245GB) of datafile (50GB)!
Go to Top of Page

dewacorp.alliances

452 Posts

Posted - 2008-02-12 : 11:50:37
quote:
\No, I don't want shrink the file! I want to decrease allocation file (245GB) of datafile (50GB)!



That is what CShaw said. You need DBCC Shrinkfile on the specific file (data or tlog file). See BOL regarding this syntax. That 250GB will take awhile to shrink it. Log the time this on your UAT environment to see how long it takes.

Go to Top of Page

spider
Starting Member

3 Posts

Posted - 2008-02-12 : 12:28:34
ok thank you very much!
Go to Top of Page
   

- Advertisement -