June 16, 2015 at 8:10 pm
Hi,
I am getting server error while trying to shrink the datafile
history: we did some huge data purge on the db.
original size of file : 1778050 MB
free space: 45%
ScriptUsed:
USE [office]
GO
DBCC SHRINKFILE (N'office_db' , 1757810)
GO
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
can someone help me on this issue?
June 17, 2015 at 2:05 pm
Is this SQL Server 2005? If so, what is the version number/patch level?
Joie Andrew
"Since 1982"
June 17, 2015 at 9:27 pm
Jo_DBA (6/16/2015)
Hi,I am getting server error while trying to shrink the datafile
history: we did some huge data purge on the db.
original size of file : 1778050 MB
free space: 45%
ScriptUsed:
USE [office]
GO
DBCC SHRINKFILE (N'office_db' , 1757810)
GO
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
can someone help me on this issue?
It's an odd thing. There's no reason for it but I don't believe that you can be in the database that you're attempting to shrink a file of. Try USE MASTER instead.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2015 at 9:47 pm
It's an odd thing. There's no reason for it but I don't believe that you can be in the database that you're attempting to shrink a file of. Try USE MASTER instead.
Actually you have to be in the database you want to use DBCC SHRINKFILE against. There is no way to specify the db when using DBCC SHRINKFILE, only file id or file name. If you are in MASTER DBCC SHRINKFILE will always try to shrink data/log files in MASTER.
Joie Andrew
"Since 1982"
June 17, 2015 at 11:23 pm
Yeah... you're right, Joie. I'm not sure which command I was thinking about but it certainly isn't DBCC ShrinkFile that has this problem. Thank you for the catch.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply