Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
DeepGround
Yak Posting Veteran
73 Posts |
Posted - 2008-11-11 : 12:17:45
|
Hello,When configuring a Job under the Database drop down it does not have an option for ALL DATABASES. How would I do this as the names of the databases are changing randomly and new ones are appearing every day. Thanks |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-11-11 : 12:26:21
|
You can use sp_Msforeachdb system store proc to loop through all databases.What are you trying to run? |
|
|
DeepGround
Yak Posting Veteran
73 Posts |
Posted - 2008-11-11 : 12:28:56
|
I need to shrink the log to 1MegEXEC sp_msforeachdb "USE ? DBCC SHRINKFILE(1)"Would that work? |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-11-11 : 12:39:22
|
quote: Originally posted by DeepGround I need to shrink the log to 1MegEXEC sp_msforeachdb "USE ? DBCC SHRINKFILE(1)"Would that work?
You need to give log file name as well so use this:http://www.sqlservercentral.com/scripts/Maintenance+and+Management/31533/Also did you figure out what is causing it to grow so huge? |
|
|
DeepGround
Yak Posting Veteran
73 Posts |
Posted - 2008-11-11 : 12:41:27
|
Have no idea, its happening to all of our servers, and its not good. Every Forum and Microsoft article I have found says that Simple should not allow the log to grow, it should keep it cleared out. I am just trying to stop it now.All of our databases do not have the same log file name, it will not allow us to share the same log file, how do I tell it to use the file assigned to the database? |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-11-11 : 12:42:50
|
Did you see the link I provided? |
|
|
DeepGround
Yak Posting Veteran
73 Posts |
Posted - 2008-11-11 : 12:44:06
|
I am registering right now |
|
|
DeepGround
Yak Posting Veteran
73 Posts |
Posted - 2008-11-11 : 12:46:54
|
Yes perfect, thank you, this will at least allow me to hold off the random growth. |
|
|
|
|
|