Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Shrink Log file for all Databases


Shrink Log file for all Databases

Author
Message
David Bird
David Bird
Old Hand
Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)

Group: General Forum Members
Points: 317 Visits: 1190
Comments posted to this topic are about the item Shrink Log file for all Databases

David Bird

My PC Quick Reference Guide
F. van 't Hoff
F. van 't Hoff
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 6
I've tried this script, but it will only work if there are no spaces in the db_name. We have a database named Mediabin Repository and when I run this script, I'll get the following error:
"Msg 911, Level 16, State 1, Line 1"
"Could not locate entry in sysdatabases for database 'MediaBin'. No entry found with that name. Make sure that the name is entered correctly."

What is the correct way to run this script when there are spaces in the database name?
reddi_arjun
reddi_arjun
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 103
Thanks a lot.
The script was very helpful.
TheSQLGuru
TheSQLGuru
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6971 Visits: 8388
reddi_arjun (3/18/2013)

Thanks a lot.
The script was very helpful.


PLEASE DO NOT DO THIS!!! IT IS A HORRIBLE, HORRIBLE THING TO DO ON YOUR SQL SERVER!!!

Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Lynn Pettis
Lynn Pettis
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26727 Visits: 38143
F. van 't Hoff (11/29/2011)
I've tried this script, but it will only work if there are no spaces in the db_name. We have a database named Mediabin Repository and when I run this script, I'll get the following error:
"Msg 911, Level 16, State 1, Line 1"
"Could not locate entry in sysdatabases for database 'MediaBin'. No entry found with that name. Make sure that the name is entered correctly."

What is the correct way to run this script when there are spaces in the database name?


Because your database name has a space in it, you would need to put it in brackets, [Mediabin Repository].

I also agree with Kevin. This is not something that should be done on a regular basis. I can see it as a one off due to extraordinary operations, such as a major archiving of data to another database.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search