[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

How to set localization on MSDE?

I have localization in my OS set to Britian, so the date times are DD/MM/YYYY.  Can I (and if so how) change the localizatoin on the MDSE running on the machine to properly accept these DateTime objects as valid DateTimes?  

Right, now, it throw an error because the day is too high.  

0
jjacksn
Asked:
jjacksn
2 Solutions
 
ptjcbCommented:
Control Panel - Regional Settings or options. That is what controls how SQL Server (or MSDE) sees a date.
0
 
mokuleCommented:
You can also use
SET DATEFORMAT dmy
0
 
jjacksnAuthor Commented:
ptjcb - that's what i changed, and that didn't work for MSDE.  at least in my testing.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
jjacksnAuthor Commented:
I've tried both inserting a datetime as a string in the correct format DD/MM/YYYY and as a DateTime object in .NET both while the region was set to English (UK) and both gave a SQL error that the date could not parsed.  
0
 
rafranciscoCommented:
As mokule suggested, try issuing the statement SET DATEFORMAT dmy before issuing your INSERT statement.
0
 
jjacksnAuthor Commented:
do I need to do this before every insert?
0
 
rafranciscoCommented:
If the default DATEFORMAT is not in the dmy format, then yes you have to do this before every insert.
0
 
jjacksnAuthor Commented:
how can i set the default date format?
0
 
rafranciscoCommented:
The default date format can be set in Control Panel --> Regional Options --> Date Tab.  But setting this will affect the whole server, not just SQL Server.
0
 
jjacksnAuthor Commented:
the default date should have been set by me setting my computer to British English, shouldn't it?  it changed everything else on my computer
0
 
rafranciscoCommented:
Changing the default date format in Regional Options will change all date formats in your computer and not just SQL Server.
0
 
jjacksnAuthor Commented:
can i query this value somehow to see what it is?
0
 
rafranciscoCommented:
I am not aware of any way to determine the default date format from SQL Server.
0
 
jjacksnAuthor Commented:
according to this link from MSDN (on my local machine) SQL Server 7.0 no longer depends on the OS for internationalization.  

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dnsql2k/html/intlfeaturesinsqlserver2000.htm#intlfeaturesinsqlserver2000_topic5

I'm currently searching for a way to change the column collation.  
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

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