English (United States) English (United Kingdom) English (Eire)
You are here:   Home
Register  |  Login
 Links
Minimize
 Blog_Archive
Minimize
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Monthly
August, 2010
Aug 12

Written by: kevin attard
12/08/2010 22:36

Working on a german server without knowing german is no easy task. I got this error and had to translate it.

Fehler beim Konvertieren einer Zeichenfolge in ein Datum und/oder eine Uhrzeit.

which would be

Conversion failed when converting date and/or time from character string.

The procedure was an import procedure and was expecting dates in the format of 28 MAY 2010. Unfortunately the development server was in german format, so I was getting the above error on the following line

select CONVERT(DATETIME,'28 MAY 2010',106) 

Changing it to the german equivalent did the trick

select CONVERT(DATETIME,'28 MAI 2010',106) 

But the client wanted the dates to remain in english and that was when i descovered the following syntax

SET LANGUAGE British.

Using this syntax before the procedure not only was setting the dates to british date format but also prompting the error messages in English :)

 

Tags:

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment    Cancel