Shrinking A File In SQL Server

sqlinsix(58)
Published in
#data
Words
193
Reading
1 min
Listen
Play
6y

Check out the solution in the video TSQL: DBCC SHRINKFILE Part I. Depending on the environment and setup, we may be required to shrink a file in SQL Server (such as a log file). Lower environments (generally, development and QA) tend to have tighter restrictions on space that we don't have as much in pre-production or production environments. This isn't to say that these are ideal setups, just what we tend to find. I would use extreme caution in shrinking any file in production for a multitude of reasons.

Automating ETL
Check out the highest-rated Automating ETL course on Udemy, if you're interested in data.

As a caution, I will rarely shrink a file in SQL Server because the impact of shrinking a file. Good architects will pre-plan the log size and not have a reactive setup, though you'll find the reactive setup a popular choice in many environments. There is a direct correlation between micro-management of logs and eventual database corruption: I have seen 0 instances of database corruption in environments where logs were pre-planned and the model was followed with no exceptions.

YouTube | Automating ETL | T-SQL In 2 Hours | Consumer Guide To Digital Security

Shrinking A File In SQL Server | Ecency