I create a new maintenance plan in SQL 2005 to shrink a LOG file ,i place "execute SQL command" using the maintenance plan designer ,that has the following code:
DBCC SHRINKFILE (NEW_HEALTH_log_1 ,1)
the code executes perfectly using the query window ,BUT when executed through the maintenance plan it displays the following error:
Executing the query "DBCC SHRINKFILE (NEW_HEALTH_log_1 ,1)
" failed with the following error: "Could not locate file 'NEW_HEALTH_log_1' 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.
why is it going to master instead of MY DATABASE NEW_HEALTH?