Skip to main content

Shrinking Databases bit-by-bit to avoid long delays

Michael Jones has a neat script for shrinking databases in small chunks to avoid having the server locked up for a long period. declare @sql varchar(8000) declare @name sysname declare @sizeMB int declare @UsedMB int declare @FreeMB int declare @ShrinkMB int — Desired free space in MB after shrink set @FreeMB = 1000 — Increment […]

What with this database called [$(DatabaseName)] ?

What with this database called [$(DatabaseName)] ?

I just handed a work mate an output script from DataDude, which he ran in Management Studio. Instead of producing the expected database he ended up with one called $(DatabaseName) Remember database pro uses SQLCMD to deploy databases If you use Management Studio to run an output script, you’ll need to swap into SQLCMD mode […]