select 'use ' + ltrim(rtrim(db_name(sd.dbid))) + char(13) + 'dbcc shrinkfile (' + quotename(ltrim(rtrim(sf.name)),'''') + ' ,truncateonly)' from sysaltfiles sf
inner join sysdatabases sd on sf.dbid = sd.dbid
where sd.dbid > 4
Showing posts with label SQL Server 2000. Show all posts
Showing posts with label SQL Server 2000. Show all posts
Wednesday, April 14, 2010
Shrink SQL Server 2000 Database
Query to generate DBCC shrinkfile script for all the user databases in SQL Server 2000
Subscribe to:
Posts (Atom)