This Blog is a knowledgebase of my daily business. I hope you'll find answers to your questions.
Tuesday, March 5, 2013
SQL Query: Shrink all DBs
DO NOT USE THIS SCRIPTS WITHIN YOUR PROD ENVIRONMENT!!!!
sp_MSForEachDB '
backup log [?] to disk = ''nul'''
go
sp_MSForEachDB '
use [?];
checkpoint
'
go
sp_MSForEachDB '
USE [?];
DBCC SHRINKFILE (N''?_log'' , 1024)
'
go
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment