Tempdb is not being shrinked

  • hi,

    I have created new tempfiles with 1G each, and want to shink the default temfile to 1G as well.

    T-SQL that i use

    use tempdb

    dbcc shrinkfile (tempdev, 1024)

    go

    it works fine but when checking select (size*8) as FileSizeKB from sys.database_files it gives old values.

    do we have to restart SQL server to make it persistent or how to overcome this.

    Regards,
    MShenel

  • update stats on your tempdb after shrink.

    use tempdb

    go

    exec sp_updatestats

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • updating usage stats did change anything. still same.

    Regards,
    MShenel

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply