Sql Shrink: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

11 January 2025

  • curprev 10:4310:43, 11 January 2025Karavi talk contribs 400 bytes +400 Created page with "→‎Script to shrink all databases: declare @db varchar(255) declare c cursor for select name from sys.databases where is_read_only=0 and state=0 and name not in ('master','model','tempdb','msdb') open c fetch c into @db while @@fetch_status=0 begin exec SP_dboption @db,'trunc. log on chkpt.','true' DBCC shrinkdatabase (@db,10) fetch next from c into @db end close c deallocate c"