select 'use ' + db_name(dbid) + char(13) + 'dbcc shrinkfile (' + quotename(sf.name,'''') + ' ,truncateonly)' from sysaltfiles sfinner join sys.databases sd on sf.dbid = sd.database_idwhere state_desc = 'online'
No comments:
Post a Comment