DECLARE @cmd VARCHAR(6000)
SET @cmd = 'USE [?] ;
declare @filename varchar(1000), @dbcc varchar(2000), @alter
varchar(1000), @size int
select @filename = name, @size = (size+127)/128 from sys.sysfiles
where filename like ''%ldf''
print db_name()
print @filename
set @dbcc = ''dbcc shrinkfile (xx, 2)''
set @dbcc = REPLACE(@dbcc, ''xx'' ,@filename)
set @alter = ''ALTER DATABASE ['' + db_name() +
''] MODIFY FILE ( NAME = xx, SIZE = '' + convert(varchar, @size ) +
''MB, FILEGROWTH = 10%)''
set @alter = REPLACE(@alter, ''xx'' ,@filename)
print @dbcc
print @alter
exec (@dbcc)
exec (@alter)
'
Exec sp_msforeachdb @cmd
I had this issue few day ago and couldn't fix it. Thats when I started googling and found a team of friendly people called called ServerBuddies.
ReplyDeleteThey provide quality remote server management, including troubleshooting, Server Management, Plesk Support, Server Maintenance, Server Monitoring, Server Troubleshooting and support at a affordable rates. Here are option for Server Management, Server Maintenance, Server Monitoring, Server Troubleshooting, Server Optimization, Plesk Support, Linux Support, cPanel Support and Plesk Support.
They are great, I highly recommend to use these guys!
thank you for your great post. I really appreciate the efforts you have put in your blog .It is interesting and helpful. Good luck with it!!!
ReplyDeleteSQL Reporting Services
Superb i really enjoyed very much with this article here. Really its a amazing article i had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.my sources school signs uk
ReplyDeleteI lately got here helped here all through your blog and were dissecting nearby. I figured I would leave my most fundamental remark. I dont see what to articulate except for that I have treasured checking out.. Pc Reviver Licence Key
ReplyDeleteCultivating Simulator most recent variant is accommodates the client many astonishing highlights and extremely simple to use for the every client.Farming Simulator 21 Download
ReplyDelete