• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • Last Modified:

Problems inserting date in table with different locale other than en-US

I have a DateTime in the format:  20/07/2007 08:14:18

I am trying to insert that into a table column whose format is DateTime (the locale is en-GB)...

I have two questions:
1.  when I installed SQL Server Express 2005 on my Win 2000 Pro machine (running in a virtual machine), whose locale was en-GB, did I have to do anything during the install to tell SQL Server of that locale?
2.  how do I get the date above into the column without getting a conversion error?

1 Solution
The easy way, which forces the locale to be ignored, is to format it as a long, such as
    dd mmm yyyy hh:nn:ss
By expanding the numerical month into the month name, any locale will understand it correctly.
Aneesh RetnakaranDatabase AdministratorCommented:
set dateformat dmy
insert into urTable ...
rmmarshAuthor Commented:
Ah yes, how simple (I forgot about that)... thank you so much...

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now