I have a script that delete records daily and shrinks the log file. I tested it with the SQL Analyzer and I should get the same results? I put this in a job that runs at night and when checking today when I got in the jobs ran successfully but the datafile continued to grow along with the transaction log. Here is the script:
delete * FROM dbo.INCOMING_temp
WHERE DATE_TIME <=dateadd(day, -180, getdate())
DBCC SHRINKFILE(wslogdb62_log, 1)
as you know I get a error from the analyzer.
Server: Msg 8985, Level 16, State 1, Line 3
Could not locate file 'wslogdb62_log' in sysfiles.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Even with the code you gave me.