In SQL Server, when using Transact-SQL, reducing the size of a data file requires a different syntax to increasing it. To reduce a file size using T-SQL, use the DBCC SHRINKFILE
command, and provide the name of the data file along with the size you’d like to reduce it to.
Below are examples of reducing the file size of a data file in SQL Server using T-SQL.