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 |
|
ajspruit911
Starting Member
3 Posts |
Posted - 2008-10-10 : 07:15:04
|
| Hi all Im reletivly new to SQL and scripting and am having some trouble with a script that i wrote. As per normal most of the individual elements work seperately but they don't work together as a whole.Aim: Make sure recovery mode is set to simple and shrink transaction log before doing the backup.The backups are done via SQL Lightspeed with a clean up script to follow.Script:declare @dbname varchar(45) select @dbname = DB_NAME() print @dbnameuse master ALTER DATABASE @dbname SET RECOVERY SIMPLEdeclare @logname varchar(45) use @dbname select @logname = rtrim(name) from sysfiles where name like '%log%' print @lognamedump transaction @dbname with no_logdbcc shrinkfile (@logname, 2)Sorry, i know it's messy but i will sort that out later, any assistance on getting this working or a better alternitive would be much appriated. thanks in advanceAJ |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|