none
I am trying to shrink Data file and getting this error

Answers

All replies

  • is that the value you entered in the field "shrink file to:" ?

    That value has to be greater than the "minimum" file size and smaller than the "maximum" file size that has been set for the particular file.


    Sanil Mhatre | Database Developer | MCTS | If you find my reply useful in any way, please vote it as helpful. If it has helped answer your question, please mark it as Answer. http://sqlwithsanil.com

    Tuesday, August 06, 2013 10:36 PM
  • Shrink file like below:

    USE [AdventureWorks2008R2]
    GO
    DBCC SHRINKFILE (N'AdventureWorks2008R2_Data' , 10)--change value 10 as per your
    GO

    • Edited by Pradeep_DBA Tuesday, August 06, 2013 11:01 PM Help
    Tuesday, August 06, 2013 10:59 PM
  • Hello!

    Remember, this is not a good pratice:

    http://www.sqlskills.com/blogs/paul/why-you-should-not-shrink-your-data-files/

    If you wanna shrink anyway follow the article below:

    http://technet.microsoft.com/en-us/library/ms190757.aspx


    Regards,

    André César Rodrigues

    Please click the Mark as answer button and vote as helpful if this reply solves your problem. Thanks!

    Blog: http://sqlmagu.blogspot.com.br  LinkedIn:   

    Tuesday, August 06, 2013 11:05 PM
  • Agree with Andre, That we should not go for data file shrink until you don't have other option like adding ndf files to other drive/locations....etc.


    • Edited by Pradeep_DBA Tuesday, August 06, 2013 11:16 PM Help
    Tuesday, August 06, 2013 11:15 PM
  • It is not always advisable to shrink data files as these files are usually growing. There are cases when one database can be separated in multiple databases. Shrinking database or data files can be long time process but it there are very small chances of data lose.

    Following is the script to shrink whole database.
    DBCC SHRINKDATABASE (dbName)

    Following is the script to shrink single file.
    DBCC SHRINKFILE (logicalLogFileName)

    Wednesday, August 07, 2013 3:59 AM
  • As the others wrote, never shrink a database!

    And if you do it, you have to apply correct values for the size, which must be equal or higher as the minimum file size, as the error already clearly stats.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Wednesday, August 07, 2013 4:10 AM