Help: SQL Server

Sharing my knowlege about SQL Server Troubleshooting Skills

  • Blog Stats

    • 1,681,147 hits
  • Select GETDATE()

    December 2014
    M T W T F S S
    « Nov   Jan »
  • Advertisements

SSMS – FIX – Error – The log file is not using Unicode format

Posted by blakhani on December 11, 2014

While playing with SQL Server Agent Log setting, I changed some setting and found that I was not able to read SQLAgent Logs any more. Here is the error which I was getting in SSMS.

I followed my own blog and executed T-SQL to read the Agent log and got same error.

Msg 22004, Level 16, State 1, Line 13
The log file is not using Unicode format.

I looked around into the properties which I changed and one of them was “Write OEM error log”. As per MSDN documentation, this option writes the error log file as a non-Unicode file. This reduces the amount of disk space consumed by the log file. However, messages that include Unicode data may be more difficult to read when this option is enabled.

And that’s precisely the error message says – “it’s not in unicode”.

There are two ways to fix the error.

Method 1 (UI Based)

  • Connect to Object Explorer to SSMS > Expand “SQL Server Agent” >  Right Click on “Error Logs” and choose “Configure”
  • Over there uncheck the box “Write OEM error log”

Method 2 (T-SQL Based)

Execute below query

USE [msdb]
EXEC msdb.dbo.sp_set_sqlagent_properties @oem_errorlog=0

Both of the methods have same effect. Once done, restart SQL Agent service so that now the file is written in unicode format. You should be able to view the log in the viewer now.

Hope this helps.

  • Cheers,
  • Balmukund Lakhani
  • Twitter @blakhani
  • Author: SQL Server 2012 AlwaysOnPaperback, Kindle
  • Advertisements

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google photo

    You are commenting using your Google account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s

    %d bloggers like this: