When I run this code in the query tool, it works. But I put the exact code in a T-SQL Task of a Maintenance Plan and I get the following error:
Status: Warning: One or more tasks failed..
Execute T-SQL Statement Task (ALX-ENGCSRV32)
Execute TSQL on Local server connection
Execution time out: 30000
Task start: 2010-09-24T12:24:41.
Task end: 2010-09-24T12:24:41.
Failed:(-1073548784) Executing the query "DBCC SHRINKFILE (N'MES_HDL_Batch_log' , 0, TRUNCATEONLY) WITH NO_INFOMSGS;
" failed with the following error: "Could not locate file 'MES_HDL_Batch_log' for database 'master' in sys.database_files. The file either does not exist, or was dropped. ". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,
parameters not set correctly, or connection not established correctly.
DBCC SHRINKFILE (N'MES_HDL_Batch_log' , 0, TRUNCATEONLY) WITH NO_INFOMSGS;
I understand the problem but don't know how to fix it - not looking at right database in order to find the log file.
FYI: I'm in a manufacturing environment and working with a older boxed product where transaction log just grows and grows. We don't ever roll transactions back or anything so that's
View Complete Post