1/23/2024 0 Comments Adventureworks2012 documentation![]() ![]() In other words, EMPTYFILE migrates data from a specified file to other files in the same filegroup. Migrates all data from the specified file to other files in the same filegroup. For example, if 7 MB of a 10-MB data file is used, a DBCC SHRINKFILE statement with a target_size of 6 shrinks the file to only 7 MB, not 6 MB. DBCC SHRINKFILE doesn't shrink a file past the needed stored data size. For example, with a 10-MB data file, a DBCC SHRINKFILE operation with an 8 target_size moves all used pages in the file's last 2 MB into any unallocated pages in the file's first 8 MB. ![]() Used pages in the file's area to be freed are moved to free space in the file's kept areas. ![]() If specified, DBCC SHRINKFILE tries to shrink the file to target_size. This option isn't supported for FILESTREAM filegroup containers. This applies only to empty files that have never contained data. For example, if you create a 5-MB file and then shrink the file to 3 MB while the file is still empty, the default file size is set to 3 MB. You can reduce an empty file's default size using DBCC SHRINKFILE. If not specified or 0, DBCC SHRINKFILE reduces to the file creation size. target_sizeĪn integer representing the file's new megabyte size. To get a file ID, use the FILE_IDEX system function or query the sys.database_files catalog view in the current database. The file to be shrunk's identification (ID) number. To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, see Previous versions documentation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |