April 28, 2006 at 9:15 am
I would like to create a Job which executes two statements to truncate a log and shrink the log file. I have specified the following in the Edit Job Dialog Box:
Type: Transact-SQL Script (TSQL)
Database: UserDB
Command:
BACKUP LOG bb_bb60 WITH Truncate_Only
DBCC SHRINKFILE (bb_bb60_LOG, 500)
Do I need the 'Go' TSQL Statment after each command? Should the Database be the Master DB or the User DB which has the log to be truncated and shrunk?
We are running SQL Server 2003 Standard Edition (sp3) on Windows 2003 EE.
Thanks in advance, Kevin
April 28, 2006 at 9:30 am
Yes you can execute multiple SQL pieces. More or less the input is a script just like QA works. You do not neccessarily have to put a GO in bu you can if you feel needs to seperate the batch.
April 28, 2006 at 9:41 am
You might want to consider seperating out these actions into different job steps. In case something goes wrong it might be easier to troubleshoot it down the line.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply