4.7 (3)
Rating
(2)
(1)
(0)
(0)
(0)

FAQ-Wiki-SQL Server

There has been an error converting into datetime format while importing scripts into SQL SERVER 2005

If you see the following error after running your scripts:

Server: Msg 242, Level 16, State 3, Line 1

[Microsoft][ODBC SQL Server Driver][SQL Server] The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

The statement has been terminated.

Answer:

It means that you should change the server language settings by doing the following:

  1. Start Management Studio.
  2. Choose the necessary server.
  3. Go to Security\Logins.
  4. Choose the user that will be using the database and open the user's properties window.
  5. Select English in the Default Language for user dropdown list and press OK.
  6. Now you can run the script saved on your hard drive by Recovery Toolbox for SQL Server. Alternatively, you can start the program in the database scripts execution mode.
  7. Now you need to restore the settings. To do that, open the properties window of the necessary user Management Studio.
  8. Select the default language in the Default Language for user list and press OK.