select 'use ' + ltrim(rtrim(db_name(sd.dbid))) + char(13) + 'dbcc shrinkfile (' + quotename(ltrim(rtrim(sf.name)),'''') + ' ,truncateonly)' from sysaltfiles sfinner join sysdatabases sd on sf.dbid = sd.dbidwhere sd.dbid > 4
[...] Shrink SQL Server 2000 Database « Database Solutions (MSSQL and MySQL) [...]
[...] Shrink SQL Server 2000 Database « Database Solutions (MSSQL and MySQL) [...]
ReplyDelete