设置SQL Server 2005的区域设置 [英] Set Locale of a SQL Server 2005
问题描述
默认情况下,SQL Server附带的Langauge设置为英文(美国),将日期格式设置为mm / dd / yy,而不是我想要的日期格式,这是澳大利亚的,并且具有日期格式例如dd / mm / yy。
By default the SQL Server comes with the Langauge set to "English (United States)", setting the date format to mm/dd/yy instead of the date format I want it in, which is Australian and has a date format such as dd/mm/yy.
在Server Management Studio /配置工具中有一个可以设置SQL Server的区域设置的选项,这将阻止DateTime字段格式化为美国日期格式?
Is there an option in the Server Management Studio / Configuration tools where I can set the locale of the SQL Server, which will prevent the DateTime fields from being formatted in US date format?
如果没有,当我使用SQL查询时如何转换它(如果语法错误,请原谅) ,我现在做了):
If not, how can I convert it when I am using a SQL query such as (forgive me if there is incorrect syntax, I made it up on the spot):
Dim dc As New SqlCommand("INSERT INTO hello VALUES (@Date)", cn)
dc.Parameters.Add(New SqlParameter("Date", System.DateTime.Now))
非常感谢提前。 :
推荐答案
您可以从SQL Management Studio设置每个用户的默认语言/区域设置(查看安全文件夹)。
You can set the default language/locale of each user from SQL Management Studio (look under the Security folder).
使用SET LANGUAGE命令(如果您只想更改日期格式,请使用SET DATEFORMAT)覆盖此特定连接。
And override this for a specific connection using the SET LANGUAGE command (or SET DATEFORMAT if you just want to change the date format).
您还可以在SQL Management Studio中设置默认语言(用于新用户):右键单击服务器,选择属性/高级/默认语言。
You can also set the default language (used for new users) in SQL Management Studio: right-click on the server, select Properties/Advanced/Default Language.
这篇关于设置SQL Server 2005的区域设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!